pyvista.DataSet.find_cells_within_bounds

pyvista.DataSet.find_cells_within_bounds#

DataSet.find_cells_within_bounds(bounds: BoundsTuple) NumpyArray[int][source]#

Find the index of cells in this mesh within bounds.

Parameters:
boundssequence[float]

Bounding box. The form is: (x_min, x_max, y_min, y_max, z_min, z_max).

Returns:
numpy.ndarray

Index or indices of the cell in this mesh that are closest to the given point.

Examples

>>> import pyvista as pv
>>> mesh = pv.Cube()
>>> index = mesh.find_cells_within_bounds(
...     [-2.0, 2.0, -2.0, 2.0, -2.0, 2.0]
... )