UnstructuredGrid.polyhedron_face_location_offsets#
- property UnstructuredGrid.polyhedron_face_location_offsets: NumpyArray[int][source]#
Return the offsets array of the polyhedron face locations.
The offsets array has
n_cells+ 1values and stores the index intopolyhedron_face_location_connectivityat which each cell begins. The face ids of cellirun frompolyhedron_face_location_offsets[i]topolyhedron_face_location_offsets[i + 1]inpolyhedron_face_location_connectivity.Every cell has an entry, not just the polyhedra. A cell that is not a
POLYHEDRONhas no faces of its own, so its two offsets are equal and its slice is empty. A grid holding no polyhedron at all has no face locations for VTK to store, and the array is[0].Added in version 0.49.
- Returns:
numpy.ndarrayArray of face location offsets with
n_cells + 1values.
- Raises:
pyvista.core.errors.VTKVersionErrorIf VTK is older than 9.4, which stores polyhedra as a single padded face stream instead.
Notes#
This property is read-only. VTK can only replace the face locations together with the cells, the cell types and the faces, so there is no way to assign them alone without leaving the grid inconsistent. Build a new grid instead.
Examples#
Download Python source code | Download Jupyter notebook
>>> import pyvista as pv
>>> from pyvista import examples
>>> grid = examples.cells.Polyhedron()
>>> grid.polyhedron_face_location_offsets
array([0, 4]...)
There is one entry per cell regardless of whether the cell is a polyhedron.
>>> len(grid.polyhedron_face_location_offsets) - 1 == grid.n_cells
True
See Also#
polyhedron_face_location_connectivityIds of the faces that make up each cell.
polyhedron_face_offsetsIndex into the point ids at which each face begins.
polyhedron_face_locationsFace locations in the legacy padded format.