# create separated regions from polydata

**URL:** https://discourse.vtk.org/t/create-separated-regions-from-polydata/10409
**Category:** Support
**Tags:** python
**Created:** [January 9, 2023, 5:32pm UTC](https://discourse.vtk.org/t/create-separated-regions-from-polydata/10409 "2023-01-09T17:32:28Z")
**Posts on this page:** 1
**Showing post:** 26

<div class="post-metadata">

### Author: ![PBrockmann](https://discourse.vtk.org/user_avatar/discourse.vtk.org/pbrockmann/32/524_2.png) [@PBrockmann](https://discourse.vtk.org/u/PBrockmann)
#### Post date: [April 3, 2023, 5:47pm UTC](https://discourse.vtk.org/t/create-separated-regions-from-polydata/10409/26 "2023-04-03T17:47:50Z")

</div>

I can reproduce what the vedo code from @marcomusy has proposed with the VTK API.  
But the split function from the vedo code gives anyway an uncorrect number of regions.

I have prepared 3 vtk files to play with.  
[https://thredds-su.ipsl.fr/thredds/fileServer/ipsl\_thredds/brocksce/tmp/poly\_11.vtk](https://thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds/brocksce/tmp/poly_11.vtk)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/5/557bb30ddb8a0349e2f82ef8a83b4273d0247eea.png)

[https://thredds-su.ipsl.fr/thredds/fileServer/ipsl\_thredds/brocksce/tmp/poly\_07.vtk](https://thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds/brocksce/tmp/poly_07.vtk)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/f/f5b1d63e1aea015368bd73ebe174bcb5029c4b84.png)

[https://thredds-su.ipsl.fr/thredds/fileServer/ipsl\_thredds/brocksce/tmp/poly\_03.vtk](https://thredds-su.ipsl.fr/thredds/fileServer/ipsl_thredds/brocksce/tmp/poly_03.vtk)  
 ![image](https://discourse.vtk.org/uploads/default/original/2X/6/6f852e547450d233ee1d1a4cc5e66b030c6aa8b9.png)

In the poly\_11.vtk, I expect to find 2 regions.  
In the poly\_07.vtk, 3 regions.  
In the poly\_03.vtk, 1 region.

```auto
from vedo import *
m = Mesh("poly_07.vtk").clean().triangulate()
ms = m.split(must_share_edge=True) # return a list of meshes
print(len(ms))

```

Gives 1 instead of 3.

---

_[View the full topic](https://discourse.vtk.org/t/create-separated-regions-from-polydata/10409)._
