pyvista.ExplicitStructuredGrid.cell_coords

pyvista.ExplicitStructuredGrid.cell_coords#

ExplicitStructuredGrid.cell_coords(ind: int | VectorLike[int]) None | MatrixLike[int][source]#

Return the cell structured coordinates.

Parameters:
indint | VectorLike[int]

Cell IDs.

Returns:
numpy.ndarray | None

Cell structured coordinates. None if ind is outside the grid extent.

See also

pyvista.ExplicitStructuredGrid.cell_id

Return the cell ID.

Examples

>>> from pyvista import examples
>>> grid = examples.load_explicit_structured()
>>> grid.cell_coords(19)
array([3, 4, 0])
>>> grid.cell_coords((19, 31, 41, 54))
array([[3, 4, 0],
       [3, 2, 1],
       [1, 0, 2],
       [2, 3, 2]])