pyvista.Cube#
- Cube(
- center: VectorLike[float] = (0.0, 0.0, 0.0),
- x_length: float = 1.0,
- y_length: float = 1.0,
- z_length: float = 1.0,
- bounds: VectorLike[float] | None = None,
- clean: bool = True,
- point_dtype: str = 'float32',
立方体を作成します.
中心と辺の長さを指定することも,立方体の境界だけを指定することもできます.
boundsが与えられた場合,他の全ての引数は無視されます.バージョン 0.33.0 で変更: The cube is created using vtkCubeSource. For compatibility with
pyvista.PlatonicSolid(), face indices are also added as cell data. For full compatibility withPlatonicSolid(), one has to usex_length = y_length = z_length = 2 * radius / 3**0.5. The cube points are also cleaned by default now, leaving only the 8 corners and a watertight (manifold) mesh.- パラメータ:
- centersequence[
float], default: (0.0, 0.0, 0.0) [x, y, z]の中心.- x_length
float, default: 1.0 x方向の立方体の長さ.
- y_length
float, default: 1.0 y方向の立方体の長さ.
- z_length
float, default: 1.0 z方向の立方体の長さ.
- boundssequence[
float],optional Specify the bounding box of the cube. If given, all other size arguments are ignored.
(x_min, x_max, y_min, y_max, z_min, z_max).- cleanbool, default:
True メッシュの生のポイントをクリーンにして,キューブを多様化するかどうか.これはメッシュに付属するテクスチャ座標を劣化させるので,キューブにテクスチャをマッピングする予定がある場合は,これを
Falseに設定することを検討してください.Added in version 0.33.0.
- point_dtype
str, default: 'float32' 希望の出力ポイントタイプを設定する。float32' または 'float64' のいずれかでなければなりません。
Added in version 0.44.0.
- centersequence[
- 戻り値:
pyvista.PolyData立方体のメッシュです.
例
デフォルトの立方体を作成します.
>>> import pyvista as pv >>> mesh = pv.Cube() >>> mesh.plot(show_edges=True, line_width=5)