pyvista.DataSet.point_is_inside_cell

pyvista.DataSet.point_is_inside_cell#

DataSet.point_is_inside_cell(
ind: int,
point: VectorLike[float] | MatrixLike[float],
) bool | NumpyArray[np.bool_][source]#

Return whether one or more points are inside a cell.

Added in version 0.35.0.

Parameters:
indint

Cell ID.

pointVectorLike[float] | MatrixLike[float]

Point or points to query if are inside a cell.

Returns:
bool or numpy.ndarray

Whether point(s) is/are inside cell. A single bool is only returned if the input point has shape (3,).

Examples

>>> from pyvista import examples
>>> mesh = examples.load_hexbeam()
>>> mesh.get_cell(0).bounds
BoundsTuple(x_min=0.0, x_max=0.5, y_min=0.0, y_max=0.5, z_min=0.0, z_max=0.5)
>>> mesh.point_is_inside_cell(0, [0.2, 0.2, 0.2])
True