pyvista.PolyData.from_irregular_faces

pyvista.PolyData.from_irregular_faces#

classmethod PolyData.from_irregular_faces(
points: MatrixLike[float],
faces: Sequence[VectorLike[int]],
)[ソース]#

pyvista.PolyData の代替コンストラクタは,点配列と不規則的な面配列から構成されます.

パラメータ:
pointsMatrixLike[float]

ポイントの (n_points, 3) 配列.

facesSequence[VectorLike[int]]

点のインデックスを含む面ベクトル列.

戻り値:
pyvista.PolyData

新しく構築されたメッシュ.

5つの点と5つの面からピラミッドを作ります

>>> 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()
../../../_images/pyvista-PolyData-from_irregular_faces-1_00_00.png