UnstructuredGrid.polyhedron_face_location_offsets

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 + 1 values and stores the index into polyhedron_face_location_connectivity at which each cell begins. The face ids of cell i run from polyhedron_face_location_offsets[i] to polyhedron_face_location_offsets[i + 1] in polyhedron_face_location_connectivity.

Every cell has an entry, not just the polyhedra. A cell that is not a POLYHEDRON has 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.ndarray

Array of face location offsets with n_cells + 1 values.

Raises:
pyvista.core.errors.VTKVersionError

If 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.

See Also#

polyhedron_face_location_connectivity

Ids of the faces that make up each cell.

polyhedron_face_offsets

Index into the point ids at which each face begins.

polyhedron_face_locations

Face locations in the legacy padded format.