pyvista.ExplicitStructuredGrid.cell_coords#
- ExplicitStructuredGrid.cell_coords(ind: int | ndarray[Any, dtype[integer]] | Sequence[int]) None | Tuple[int] | ndarray[Any, dtype[integer]] | Sequence[ndarray[Any, dtype[integer]] | Sequence[int]] [source]#
Return the cell structured coordinates.
- Parameters:
- ind
int
|IntVector
Cell IDs.
- ind
- Returns:
tuple
(int
),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) (3, 4, 0)
>>> grid.cell_coords((19, 31, 41, 54)) array([[3, 4, 0], [3, 2, 1], [1, 0, 2], [2, 3, 2]])