pyvista.Polygon

目次

pyvista.Polygon#

Polygon(
center: VectorLike[float] = (0.0, 0.0, 0.0),
radius: float = 1.0,
normal: VectorLike[float] = (0.0, 0.0, 1.0),
n_sides: int = 6,
fill: bool = True,
) PolyData[ソース]#

ポリゴンを作成します.

パラメータ:
centersequence[float], default: (0.0, 0.0, 0.0)

中心は [x, y, z] です.ポリゴンの中心軸がこの点を通ります.

radiusfloat, default: 1.0

ポリゴンの半径.

normalsequence[float], default: (0.0, 0.0, 1.0)

ポリゴンの [x, y, z] の方向ベクトル.ポリゴンの向きを表すベクトルです.

n_sidesint, default: 6

ポリゴンの辺の数.

fillbool, default: True

塗りつぶしポリゴン生成の有効・無効を設定します.

戻り値:
pyvista.PolyData

ポリゴンのメッシュ.

8辺の多角形を作成します.

>>> import pyvista as pv
>>> mesh = pv.Polygon(n_sides=8)
>>> mesh.plot(show_edges=True, line_width=5)
../../../_images/pyvista-Polygon-1_00_00.png