Extract objects connected polydata

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Extract objects connected polydata

eduardo
This post has NOT been accepted by the mailing list yet.

I'm using the following code to extract the objects connected with the vtkPolyDataConnectivityFilter.

connectivityAllFilter = vtkPolyDataConnectivityFilter()
connectivityAllFilter.SetInputConnection(surface.GetOutputPort())
connectivityAllFilter.SetExtractionModeToAllRegions()
connectivityAllFilter.Update()

connectivityFilter = vtkPolyDataConnectivityFilter()
connectivityFilter.SetInputConnection(appendFilter.GetOutputPort())
connectivityFilter.SetExtractionModeToSpecifiedRegions()

           
size = connectivityAllFilter.GetRegionSizes().GetNumberOfTuples()

for x in range(0, size):
     connectivityFilter.AddSpecifiedRegion(x)
     connectivityFilter.Update()

     #LOGIC


     connectivityFilter.DeleteSpecifiedRegion(x)


Need to extract each polydata object (surface) to carry out a special treatment, however the vtkPolyDataConnectivityFilter filter is too slow, someone would have a choice?

Thank you