DataSetFilters.separate_cells

DataSetFilters.separate_cells#

DataSetFilters.separate_cells() → PolyData | UnstructuredGrid[source]#

Return a copy of the dataset with separated cells with no shared points.

This method may be useful when datasets have scalars that need to be associated to each point of each cell rather than either each cell or just the points of the dataset.

Returns:
pyvista.PolyData | pyvista.UnstructuredGrid

Mesh with isolated cells. A PolyData gives a PolyData; every other dataset gives an UnstructuredGrid.

Examples#

Download Python source code | Download Jupyter notebook

Load the example hex beam and separate its cells. This increases the total number of points in the dataset since points are no longer shared.

>>> from pyvista import examples
>>> grid = examples.load_hexbeam()
>>> grid.n_points
99
>>> sep_grid = grid.separate_cells()
>>> sep_grid.n_points
320