pyvista.UnstructuredGrid.offset#

property UnstructuredGrid.offset: NumpyArray[float][source]#

Return the cell locations array.

This is the location of the start of each cell in cell_connectivity.

Returns:
numpy.ndarray

Array of cell offsets indicating the start of each cell.

Notes

The array returned is immutable and cannot be written to. If you need to modify this array, create a copy of it using numpy.copy().

Examples

Return the cell offset array. Since this mesh is composed of all hexahedral cells, note how each cell starts at 8 greater than the prior cell.

>>> import pyvista as pv
>>> from pyvista import examples
>>> hex_beam = pv.read(examples.hexbeamfile)
>>> hex_beam.offset
array([  0,   8,  16,  24,  32,  40,  48,  56,  64,  72,  80,  88,  96,
       104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 200,
       208, 216, 224, 232, 240, 248, 256, 264, 272, 280, 288, 296, 304,
       312, 320])