Extract connected components from polydata structures


Is there any way to extract connected components from a set of planar contours (polydata)?

As shown in attached figure, I have two structures and I want to extract each of them as one component.

I have found this filter vtkPolydataConnectivityFilter, but it seems like it works on meshes.

Thank’s in advance


Polydata = surface mesh, so vtkPolydataConnectivityFilter is the right filter to use. Of course you need to connect the planar contours to form closed surfaces.