I have an STL file, I’m working on it a while to collect xyz data through the line drawn on its surface(red line).
I wrote a function using VTKCutter and believed that the class was collecting each point its implicit function(plane in this case) intersects. But it turns out, it leaves many points not included and I checked there are many more using polydata.GetPoints()
with little manipulation. Problems like that had been encountered for sure(for example in here) but though searched a lot, I could not find the solution that uses solely vtkCutter(I know I can use other methods like vtkBox and clipping but this way I prefer). I believe it is simple tolerance problem but in class’ reference page there is no method I can adjust with it. I appreciate any help. Thank you.
def set_cutter(self):
global OutLinePts
plane = vtkPlane()
plane.SetOrigin(self.center)
plane.SetNormal(self.normal)
polydata = copydeep(self.actorMain)
cutter = vtkCutter()#cutter class extract the data that intersects with the given function
cutter.SetCutFunction(plane)
cutter.SetInputData(polydata)
cutter.Update()
cutterMapper = vtkPolyDataMapper()
cutterMapper.SetInputConnection(cutter.GetOutputPort())
actor_cutter = vtkActor()
actor_cutter.SetMapper(cutterMapper)
actor_cutter.GetProperty().SetColor(colors.GetColor3d('red'))
*The red line is the actor of vtkCutter with function plane.