PolyData.from_regular_faces#
- classmethod PolyData.from_regular_faces(
- points: MatrixLike[float],
- faces: MatrixLike[int],
- deep: bool = False,
Alternate
pyvista.PolyDataconstructor from points and regular face arrays.- Parameters:
- points
MatrixLike[float] A (
n_points, 3) array of points.- faces
MatrixLike[int] A (
n_faces,face_size) array of face indices. For a triangle mesh,face_size = 3.- deepbool, default:
False Whether to deep copy the faces array into vtkCellArray connectivity data.
- points
- Returns:
pyvista.PolyDataThe newly constructed mesh.
Examples#
Download Python source code | Download Jupyter notebook
Construct a tetrahedron from four triangles
>>> import pyvista as pv
>>> points = [[1.0, 1, 1], [-1, 1, -1], [1, -1, -1], [-1, -1, 1]]
>>> faces = [[0, 1, 2], [1, 3, 2], [0, 2, 3], [0, 3, 1]]
>>> tetra = pv.PolyData.from_regular_faces(points, faces)
>>> tetra.plot()
See Also#
Used In#
Docstring Examples
PolyData.face_connectivity(1 use)PolyData.face_offsets(1 use)