PolyData.strip_offsets#
- property PolyData.strip_offsets: NumpyArray[int][source]#
Return the offsets array of the triangle strips.
The offsets array has
n_strips + 1values and stores the index intostrip_connectivityat which each strip begins. The point ids of stripiarestrip_connectivity[strip_offsets[i]:strip_offsets[i + 1]].Vertices, lines, faces, and strips are held in four separate cell arrays, each with its own offsets and connectivity.
len(strip_offsets) - 1is thereforen_strips, notn_cells.Added in version 0.49.
- Returns:
numpy.ndarrayArray of strip offsets with
n_strips + 1values.
Notes#
The returned array is read-only and cannot be modified in place. To change
the offsets, assign a new array to this property. The new offsets must remain
consistent with the current strip_connectivity; to replace both at once,
assign a pyvista.CellArray to strips. See the examples below.
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> mesh = pv.Rectangle().extrude((0, 0, 1), capping=False)
>>> mesh.strip_offsets
array([ 0, 4, 8, 12, 16]...)
The offsets and connectivity together describe each strip.
>>> mesh.strip_connectivity[mesh.strip_offsets[0] : mesh.strip_offsets[1]]
array([0, 1, 4, 5]...)
The array is read-only and writing to it raises a ValueError.
>>> mesh.strip_offsets.flags['WRITEABLE']
False
Assign a new array instead. Here the four strips are merged into two.
>>> mesh.strip_offsets = [0, 8, 16]
>>> mesh.n_strips
2
To replace the offsets and connectivity together, assign a
pyvista.CellArray to strips.
>>> mesh.strips = pv.CellArray.from_arrays([0, 4], [0, 1, 4, 5])
>>> mesh.n_strips
1
See Also#
strip_connectivityPoint ids that define the strips.
n_stripsNumber of strips, one less than the size of this array.
stripsStrips in the legacy padded format.
vert_offsets,line_offsets,face_offsetsOffsets arrays of the other
PolyDatacell types.