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 球体メッシュを複数の方法で作成する 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.SolidSphere3D空間を満たす球体.
- 球体を裏返す
Example turning a sphere inside-out.
例
デフォルトのパラメータで球体を作成します.
>>> 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)