I am trying to extract a 1D line in a 3D field mygrid (a vtkStructuredGrid or vtkUnstructuredGrid) using a vtkCutter.
A dirty way is to do a first vtkCutter with a vtkPlane myplane1 and apply to the output another vtkCutter with vtkPlane myplane2.
This solution seems to work, but what I would like to do instead is to use a vtkImplicitBoolean to create the actual line and then apply only one vtkCutter with this function but I am not sure how this vtkImplicitBoolean works.
The obvious thing to do was :
myline = vtk.vtkImplicitBoolean()
myline.SetOperationTypeToIntersection()
myline.AddFunction(myplane1)
myline.AddFunction(myplane2)
cutter = vtk.vtkCutter()
cutter.SetCutFunction(myline)
cutter.SetInput(mygrid)
cutter.Update()
line = cutter.GetOutput()
But this does not return the result I was expecting : the output is a 2D cut composed of two half planes… I tried to change the boolean operation (Union, Difference) but nothing seems to work!
It seems that a vtkCutter is only able to reduce your object dimension of 1 : 3D to 2D or 2D to 1D.
vtkCutter doc says :
In VTK, cutting means reducing a cell of dimension N to a cut surface of dimension N-1.That’s why the consecutive plane cuts works but not the dubble plane.