PolyData.from_irregular_faces#
- classmethod PolyData.from_irregular_faces( )[source]#
Alternate pyvista.PolyData convenience constructor from point and ragged face arrays.
- Parameters:
- points
MatrixLike[float] A (n_points, 3) array of points.
- faces
Sequence[VectorLike[int]] A sequence of face vectors containing point indices.
- points
- Returns:
pyvista.PolyDataThe newly constructed mesh.
See also
Examples#
Download Python source code | Download Jupyter notebook
Construct a pyramid from five points and five faces
>>> import pyvista as pv
>>> points = [
... (1, 1, 0),
... (-1, 1, 0),
... (-1, -1, 0),
... (1, -1, 0),
... (0, 0, 1.61),
... ]
>>> faces = [
... (0, 1, 2, 3),
... (0, 3, 4),
... (0, 4, 1),
... (3, 2, 4),
... (2, 1, 4),
... ]
>>> pyramid = pv.PolyData.from_irregular_faces(points, faces)
>>> pyramid.plot()