PolyData.from_irregular_faces#
- classmethod PolyData.from_irregular_faces(
- points: MatrixLikeFloat,
- faces: Sequence[VectorLikeInt],
Alternate
pyvista.PolyDataconstructor from points and ragged face arrays.- Parameters:
- points
MatrixLikeFloat A (
n_points, 3) array of points.- faces
Sequence[VectorLikeInt] A sequence of face vectors containing point indices.
- points
- Returns:
pyvista.PolyDataThe newly constructed mesh.
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()