faces

property PolyData.faces

Return a pointer to the faces as a numpy array.

Returns
numpy.ndarray

Array of face indices.

Examples

>>> import pyvista as pv
>>> plane = pv.Plane(i_resolution=2, j_resolution=2)
>>> plane.faces
array([4, 0, 1, 4, 3, 4, 1, 2, 5, 4, 4, 3, 4, 7, 6, 4, 4, 5, 8, 7])

Note how the faces contain a “padding” indicating the number of points per face:

>>> plane.faces.reshape(-1, 5)
array([[4, 0, 1, 4, 3],
       [4, 1, 2, 5, 4],
       [4, 3, 4, 7, 6],
       [4, 4, 5, 8, 7]])