cell_id#
- ExplicitStructuredGrid.cell_id(coords) Optional[Union[int, ndarray]] [source]#
Return the cell ID.
- Parameters:
- Returns:
int
,numpy.ndarray
,or
None
Cell IDs.
None
ifcoords
is outside the grid extent.
See also
pyvista.ExplicitStructuredGrid.cell_coords
Return the cell structured coordinates.
Examples
>>> from pyvista import examples >>> grid = examples.load_explicit_structured() >>> grid.cell_id((3, 4, 0)) 19
>>> coords = [(3, 4, 0), ... (3, 2, 1), ... (1, 0, 2), ... (2, 3, 2)] >>> grid.cell_id(coords) array([19, 31, 41, 54])