DataSet.find_cells_within_bounds#
- DataSet.find_cells_within_bounds(bounds: VectorLikeFloat) NDArray[np.int_][source]#
Find the index of cells in this mesh within bounds.
Warning
This filter internally builds and caches a vtkCellTreeLocator. If the mesh’s geometry is modified, the cache will no longer be valid.
- Parameters:
- bounds
VectorLikeFloat Bounding box. The form is:
(x_min, x_max, y_min, y_max, z_min, z_max).
- bounds
- Returns:
numpy.ndarrayIndices of the cells whose bounds intersect
bounds.
Examples#
Download Python source code | Download Jupyter notebook
>>> 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])