pyvista.PolyData.from_regular_faces#
- classmethod PolyData.from_regular_faces(points, faces: ndarray | Sequence[Sequence[int]], deep=False)[source]#
Alternate pyvista.PolyData convenience constructor from point and regular face arrays.
- Parameters:
- points
numpy.ndarray, sequence[sequence[float]] A (n_points, 3) array of points.
- faces
numpy.ndarrayor sequence[sequence[int]] A (n_faces, face_size) array of face indices. For a triangle mesh, face_size = 3.
- deepbool,
optional, default:False Whether to deep copy the faces array into vtkCellArray connectivity data.
- points
- Returns:
pyvista.PolyDataThe newly constructed mesh.
Examples
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)