The picture below show a model of a polydata obtained with vtkCutter. There are 2 islands, the blue one should be discarded, and the other perforated one enclosing a reference point (F1) should be kept as it is. After many hours, I could not find a way to do that. Please advise on a reliable method. Thanks.
Please check this out:
Hope it helps
Thanks for your input.
Actually, the polydata used to add the model is obtained from vtkConnectivityFilter using SetExtractionModeToAllRegions. I tried again with vtkPolyDataConnectivityFilter and did not find much difference. With SetExtractionModeToSpecifiedRegions, I can extract any individual region separately. Each region is then a closed polydata, completely filled. The holes are then no longer holes.
I need the one enclosing F-1 with the holes, and any region not enclosing F-1 and the holes should be discarded. With SetExtractionModeToClosestPointRegion, it would sometimes extract a single hole, the opposite of what I need.
The problem would be to determine which one encloses F-1 and the holes; it remains the same headache with vtkFeatureEdges as below.
N.B. : F-1 is co-planar to the polydata, F-2 is not.
If you have a seed point (i.e. a markups fiducial) you can use the Dynamic Modeler SelectByPoints tool on your first post polydata to keep the colorful island