pyvista.CellType.n_faces

Contents

pyvista.CellType.n_faces#

property CellType.n_faces: int[source]#

Return the number of faces defined by this cell type.

Added in version 0.48.

Raises:
ValueError

If the number of faces cannot be determined without a concrete instance. Polyhedron and convex point set will raise an error.

Examples

WEDGE has a fixed number of faces.

>>> import pyvista as pv
>>> pv.CellType.WEDGE.n_faces
5

POLYHEDRON has a variable number of faces and raises a ValueError.

>>> try:
...     pv.CellType.POLYHEDRON.n_faces
... except ValueError as error:
...     print(error)
Cannot determine number of faces for 'POLYHEDRON' without a concrete cell instance.

Only three-dimensional cell types have faces.

>>> pv.CellType.LINE.n_faces
0
>>> pv.CellType.QUAD.n_faces
0