CellArray.cell_offsets

CellArray.cell_offsets#

property CellArray.cell_offsets: NumpyArray[int][source]#

Return the offsets array.

The offsets array has n_cells + 1 values and stores the index into cell_connectivity at which each cell begins. The point ids of cell i are cell_connectivity[cell_offsets[i]:cell_offsets[i + 1]].

Added in version 0.49.

Returns:
numpy.ndarray

Array of cell offsets with n_cells + 1 values.

Notes#

The returned array is read-only and cannot be modified in place. Assign a new array to this property to change the offsets, or use from_arrays() to replace the offsets and connectivity together.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> cell_array = pv.CellArray.from_arrays([0, 3, 6], [0, 1, 2, 3, 4, 5])
>>> cell_array.cell_offsets
array([0, 3, 6]...)

Replace the offsets so the same connectivity describes three 2-point cells.

See Also#

cell_connectivity

Point ids that define the cells.