# 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:** 25

<div class="post-metadata">

### Author: ![Paulo\_Carvalho](https://discourse.vtk.org/user_avatar/discourse.vtk.org/paulo_carvalho/32/370_2.png) [@Paulo\_Carvalho](https://discourse.vtk.org/u/Paulo_Carvalho)
#### Post date: [March 30, 2023, 10:22pm UTC](https://discourse.vtk.org/t/create-separated-regions-from-polydata/10409/25 "2023-03-30T22:22:36Z")

</div>

For example:

```cpp
   vtkSmartPointer<vtkPolyData> poly = vtkSmartPointer<vtkPolyData>::New();
    poly->SetPoints( points );
    poly->SetLines( segments );
    poly->GetCellData()->SetScalars( dataIndexes );

```

Ports to:

```python
   poly = vtk.vtkPolyData()
   poly.SetPoints( points )
   poly.SetLines( segments )
   poly.GetCellData().SetScalars( dataIndexes )

```

---

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