# How can we separate the islands of a polydata plane?

**URL:** <https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783>\
**Category:** Support\
**Created:** [February 12, 2023, 6:41pm UTC](https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783 "2023-02-12T18:41:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [February 12, 2023, 6:41pm UTC](https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783/1 "2023-02-12T18:41:29Z")

</div>

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.

 ![SplitDisjointPolyData](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/5/3561c9d0b89354980daa7222ccbc9c0549e9a2c9.png)

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [February 12, 2023, 7:11pm UTC](https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783/2 "2023-02-12T19:11:11Z")

</div>

Hi

Please check this out:  
[https://vtk.org/doc/nightly/html/classvtkPolyDataConnectivityFilter.html#aa131a463004257e3a7d665958441444e](https://vtk.org/doc/nightly/html/classvtkPolyDataConnectivityFilter.html#aa131a463004257e3a7d665958441444e)

Hope it helps

---

<div class="post-metadata">

**Author:** ![chir.set](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/chir.set/32/66982_2.png) [@chir.set](https://discourse.slicer.org/u/chir.set)\
**Post date:** [February 12, 2023, 8:01pm UTC](https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783/3 "2023-02-12T20:01:35Z")

</div>

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.

 ![FeatureEdges](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/a/4/a40ac947b1f9148211f2b1519b595c4e4ca00646.png)

N.B. : F-1 is co-planar to the polydata, F-2 is not.

---

<div class="post-metadata">

**Author:** ![mau\_igna\_06](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/mau_igna_06/32/9056_2.png) [@mau\_igna\_06](https://discourse.slicer.org/u/mau_igna_06)\
**Post date:** [February 12, 2023, 8:10pm UTC](https://discourse.slicer.org/t/how-can-we-separate-the-islands-of-a-polydata-plane/27783/4 "2023-02-12T20:10:55Z")

</div>

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
