PolyData.n_faces#
- property PolyData.n_faces: int[source]#
Return the number of polygonal faces.
This is the total number of
TRIANGLE,QUAD, andPOLYGONcells defined in thefacesconnectivity array.See also
facesn_verts,n_lines,n_stripsNumber of cells in other connectivity arrays.
pyvista.DataSet.n_cells,pyvista.DataSet.n_pointsNumber of total cells and points in this mesh.
Examples#
Download Python source code | Download Jupyter notebook
Create a mesh with one face and one line
>>> import pyvista as pv
>>> mesh = pv.PolyData(
... [(0.0, 0, 0), (1, 0, 0), (0, 1, 0)],
... faces=[3, 0, 1, 2],
... lines=[2, 0, 1],
... )
>>> mesh.n_cells, mesh.n_faces, mesh.n_lines
(2, 1, 1)