I have an .obj file and I’m trying to find points on the file that intersect a given plane.
I did try to use vtkIntersectionPolyDataFilter. I did this by trying to create a plane using
reader = vtk.vtkOBJReader()
mapper = vtk.vtkPolyDataMapper()
if vtk.VTK_MAJOR_VERSION <= 5:
actor = vtk.vtkActor()
plane1 = vtk.vtkPlaneSource()
plane1.SetNormal(0.0, 0.0, 1.0)
mapper1 = vtk.vtkPolyDataMapper()
actor1 = vtk.vtkActor()
intersection_operation = vtk.vtkIntersectionPolyDataFilter()
print("# of crosses: " + str(intersection_operation.GetNumberOfIntersectionPoints()))
However when I run this I get:
AttributeError: ‘vtkmodules.vtkRenderingOpenGL2.vtkOpenGLPolyDataMa’ object has no attribute ‘SetInput’
I’m not sure if there is an easier way to do what I’m trying to do, but I’m pretty lost as to why this is happening. I’m pretty new to python and to vtk. Any help would be greatly appreciated.