remove_cells

ExplicitStructuredGrid.remove_cells(ind, inplace=True)

Remove cells.

Parameters
indsequence

Cell indices to be removed. The array can also be a boolean array of the same size as the number of cells.

inplacebool, optional

Whether to update the mesh in-place.

Returns
pyvista.DataSet

Same type as the input, but with the specified cells removed.

Examples

Remove 20 cells from an unstructured grid.

>>> from pyvista import examples
>>> import pyvista
>>> hex_mesh = pyvista.read(examples.hexbeamfile)
>>> removed = hex_mesh.remove_cells(range(10, 20))
>>> removed.plot(color='tan', show_edges=True, line_width=3)
../../../_images/pyvista-ExplicitStructuredGrid-remove_cells-1_00_00.png