I am trying to get intersection between 2 obj files.
first one is sphere and second one is cylinder.
I am using ‘vtkCollisionDetectionFilter’ for that.
but I did not get it.
I got 0 points in polyData.
here is my code.
def filterOBJ(path1,path2):
    reader1 = vtk.vtkOBJReader()
    reader1.SetFileName(path1)
    reader1.Update()
    mapper1 = vtk.vtkPolyDataMapper()
    if vtk.VTK_MAJOR_VERSION <= 5:
        mapper1.SetInput(reader1.GetOutput())
    else:
        mapper1.SetInputConnection(reader1.GetOutputPort())
    print(reader1.GetOutput().GetNumberOfPoints())
    # print(reader.GetOutput ().GetNumberOfPoints())
    actor1 = vtk.vtkActor()
    actor1.SetMapper(mapper1)
    ren.AddActor(actor1)
    
    reader2 = vtk.vtkOBJReader()
    reader2.SetFileName(path2)
    reader2.Update()
    mapper2 = vtk.vtkPolyDataMapper()
    if vtk.VTK_MAJOR_VERSION <= 5:
        mapper2.SetInput(reader2.GetOutput())
    else:
        mapper2.SetInputConnection(reader2.GetOutputPort())
    
    print(reader2.GetOutput().GetNumberOfPoints())
    actor2 = vtk.vtkActor()
    actor2.SetMapper(mapper2)
    ren.AddActor(actor2)
    vtk.vtkTriangle 
    collision = vtk.vtkCollisionDetectionFilter()
    collision.SetInputData(0,reader1.GetOutput())
    collision.SetInputData(1,reader2.GetOutput())
    collision.Update()
    collisionMapper = vtk.vtkPolyDataMapper()
    collisionMapper.SetInputData(collision.GetContactsOutput())
    print(collision.GetContactsOutput().GetPoints().GetNumberOfPoints())
    # print(collision.GetOutput ())
    # collisionMapper.update()
    collisionActor = vtk.vtkActor()
    collisionActor.SetMapper(collisionMapper)
    ren.AddActor(collisionActor)