cell_coords

ExplicitStructuredGrid.cell_coords(ind)

Return the cell structured coordinates.

Parameters
indint or iterable(int)

Cell IDs.

Returns
tuple(int), numpy.ndarray, or 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)  
(3, 4, 0)
>>> grid.cell_coords((19, 31, 41, 54))  
array([[3, 4, 0],
       [3, 2, 1],
       [1, 0, 2],
       [2, 3, 2]])