point_is_inside_cell#

PolyData.point_is_inside_cell(ind: int, point: Union[ndarray, Sequence[Union[List[float], Tuple[float, float, float], ndarray]], Sequence[Union[float, int, number]]]) Union[int, ndarray]#

Return whether one or more points are inside a cell.

New in version 0.35.0.

Parameters
indint

Cell ID.

pointSequence[float] or np.ndarray

Coordinates of point to query (length 3) or a numpy array of n points with shape (n, 3).

Returns
bool or numpy.ndarray

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

Examples

>>> from pyvista import examples
>>> mesh = examples.load_hexbeam()
>>> mesh.cell_bounds(0)
(0.0, 0.5, 0.0, 0.5, 0.0, 0.5)
>>> mesh.point_is_inside_cell(0, [0.2, 0.2, 0.2])
True