pyvista.ExplicitStructuredGrid.cell_coords#
- ExplicitStructuredGrid.cell_coords(ind: int | VectorLike[int]) None | MatrixLike[int] [source]#
Return the cell structured coordinates.
- Parameters:
- ind
int
|VectorLike
[int
] Cell IDs.
- ind
- Returns:
numpy.ndarray
,or
None
Cell structured coordinates.
None
ifind
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]])