pyvista.Sphere#
- Sphere(
- radius: float = 0.5,
- center: VectorLike[float] = (0.0, 0.0, 0.0),
- direction: VectorLike[float] = (0.0, 0.0, 1.0),
- theta_resolution: int = 30,
- phi_resolution: int = 30,
- start_theta: float = 0.0,
- end_theta: float = 360.0,
- start_phi: float = 0.0,
- end_phi: float = 180.0,
球を作成します.
pyvista.SolidSphere()
が3Dボリュームを満たすのに比べて,球は2Dの表面を記述します.PyVistaでは,
theta
が方位角(地球上の経度のようなもの)を表し,phi
が極角(地球上の緯度のようなもの)を表すという慣例を使っています.地球上の緯度とは対照的に,ここではphi
は北極で0度,南極で180度です.デフォルトではphi=0
が正のZ軸になります.また,theta=0
はデフォルトで正のX軸上にあります.See Create Sphere Mesh Multiple Ways for examples on creating spheres in other ways.
- パラメータ:
- radius
float
, default: 0.5 球の半径.
- centersequence[
float
], default: (0.0, 0.0, 0.0) [x, y, z]
の中心座標ベクトル.- directionsequence[
float
], default: (0.0, 0.0, 1.0) 中心
から緯度phi
度の球の北極を指す[x, y, z]
の方向座標ベクトル.- theta_resolution
int
, default: 30 方位角方向の点の数を設定します(
start_theta
からend_theta
までの範囲).- phi_resolution
int
, default: 30 極方向の点の数を設定します(
start_phi
からend_phi
まで).- start_theta
float
, default: 0.0 度単位の方位開始角度
[0, 360]
.- end_theta
float
, default: 360.0 度単位の方位終了角度
[0, 360]
.- start_phi
float
, default: 0.0 度単位の極開始角度
[0, 180]
.- end_phi
float
, default: 180.0 度単位の極終了角度
[0, 180]
.
- radius
- 戻り値:
pyvista.PolyData
球体のメッシュ.
参考
pyvista.Icosphere
正20面体の投影から作られた球体.
pyvista.SolidSphere
3D空間を満たす球体.
例
デフォルトのパラメータで球体を作成します.
>>> import pyvista as pv >>> sphere = pv.Sphere() >>> sphere.plot(show_edges=True)
end_theta
を設定して,1/4の球体を作ります.>>> sphere = pv.Sphere(end_theta=90) >>> out = sphere.plot(show_edges=True)
end_phi
を設定して,1/2の球体を作ります.>>> sphere = pv.Sphere(end_phi=90) >>> out = sphere.plot(show_edges=True)