pyvista.ExplicitStructuredGrid.hide_cells#

ExplicitStructuredGrid.hide_cells(
ind: VectorLike[int],
inplace: bool = False,
) ExplicitStructuredGrid[source]#

Hide specific cells.

Hides cells by setting the ghost cell array to HIDDENCELL.

Parameters:
indsequence[int]

Cell indices to be hidden. A boolean array of the same size as the number of cells also is acceptable.

inplacebool, default: False

This method is applied to this grid if True or to a copy otherwise.

Returns:
ExplicitStructuredGrid or None

A deep copy of this grid if inplace=False with the hidden cells, or this grid with the hidden cells if otherwise.

Examples

>>> from pyvista import examples
>>> grid = examples.load_explicit_structured()
>>> grid = grid.hide_cells(range(80, 120))
>>> grid.plot(color='w', show_edges=True, show_bounds=True)
../../../_images/pyvista-ExplicitStructuredGrid-hide_cells-1_00_00.png