pyvista.Capsule

目次

pyvista.Capsule#

Capsule(
center: VectorLike[float] = (0.0, 0.0, 0.0),
direction: VectorLike[float] = (1.0, 0.0, 0.0),
radius: float = 0.5,
cylinder_length: float = 1.0,
resolution: int = 30,
) PolyData[ソース]#

カプセルの表面を作成します。

警告

pyvista.Capsule() function rotates the capsule pyvista.PolyData in its own way. It rotates the output 90 degrees in z-axis, translates and orients the mesh to a new center and direction.

注釈

A class:pyvista.CylinderSource is used to generate the capsule mesh. For vtk versions below 9.3, a separate pyvista.CapsuleSource class is used instead. The mesh geometries are similar but not identical.

Added in version 0.44.0.

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

[x, y, z] 中のセントロイドの位置

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

[x, y, z] でカプセルが指す方向.

radiusfloat, default: 0.5

カプセルの半径。

cylinder_lengthfloat, default: 1.0

カプセルのシリンダーの長さ。

resolutionint, default: 30

円柱の円形面上の点の数です.

戻り値:
pyvista.PolyData

カプセルの表面。

デフォルトのパラメータでカプセルを作成します.

>>> import pyvista as pv
>>> capsule = pv.Capsule()
>>> capsule.plot(show_edges=True)
../../../_images/pyvista-Capsule-1_00_00.png