CellArray.cell_offsets#
- property CellArray.cell_offsets: NumpyArray[int][source]#
Return the offsets array.
The offsets array has
n_cells + 1values and stores the index intocell_connectivityat which each cell begins. The point ids of celliarecell_connectivity[cell_offsets[i]:cell_offsets[i + 1]].Added in version 0.49.
- Returns:
numpy.ndarrayArray of cell offsets with
n_cells + 1values.
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.
>>> cell_array.cell_offsets = [0, 2, 4, 6]
>>> cell_array.n_cells
3
See Also#
cell_connectivityPoint ids that define the cells.
Used In#
Docstring Examples
CellArray.from_irregular_cells(1 use)