|
Cubit Python API 17.10
|
Entity
すべてのジオメトリおよびメッシュ型の基底クラスです。 詳細...
Entity の継承図:
公開メンバ関数 |
|
| def | bounding_box (self) |
| 次のエンティティの軸平行バウンディングボックスを返します: Entity. 詳細... |
|
| def | center_point (self) |
| 次のエンティティの幾何学的中心点を返します: Entity. 詳細... |
|
| def | id (self) |
| 次のエンティティの一意な識別子を取得します: Entity. 詳細... |
|
詳細説明
すべてのジオメトリおよびメッシュ型の基底クラスです。
.. code-block:: python
メンバ関数ドキュメント
◆ bounding_box()
| def bounding_box | ( | self | ) |
次のエンティティの軸平行バウンディングボックスを返します: Entity .
Entity のジオメトリについて、X、Y、Z 各方向の最小座標と最大座標を計算します。
.. code-block:: python
# Create a half-sphere of radius 1 cut by the YZ-plane
halfSphere = cubit.sphere
(1.0, 1)
# Compute bounding box as a list [minX, minY, minZ, maxX, maxY, maxZ]
bbox = halfSphere.bounding_box()
print(f"Bounding Box: [{bbox[0]}, {bbox[1]}, {bbox[2]}] to [{bbox[3]}, {bbox[4]}, {bbox[5]}]"
) # prints [0, -1, -1] to [1, 1, 1]
@n return type of : std:: array< double,6 >
- 戻り値
- :6つの値 minX、minY、minZ、maxX、maxY、maxZ の配列(またはリスト)。
◆ center_point()
| def center_point | ( | self | ) |
次のエンティティの幾何学的中心点を返します: Entity .
現在位置に基づいて Entity のジオメトリの重心を計算します。
.. code-block:: python
# Create a unit cube (center at origin)
b = cubit.brick
(1.0, 1.0, 1.0)
# Check original center
center = b.center_point()
print(f"Original Center: ({center[0]}, {center[1]}, {center[2]})"
) # prints (0, 0, 0)
# Move the cube by (1, 2, 3)
cubit.move
(b, [1.0, 2.0, 3.0], False
)
# Check new center
center = b.center_point()
print(f"New Center: ({center[0]}, {center[1]}, {center[2]})"
) # prints (1, 2, 3)
@n return type of : std:: array< double,3 >
- 戻り値
- :Entity の中心の x、y、z 座標を表す3つの値の配列(またはリスト)。
◆ id()
| def id | ( | self | ) |
次のエンティティの一意な識別子を取得します: Entity .
次のエンティティに割り当てられた整数 ID を返します: Entity (作成時に割り当てられます)。
.. code-block:: python
# Create a unit cube
b = cubit.brick
(1.0, 1.0, 1.0)
# Get and print its ID
id = b.id()
print("Entity ID:"
, id) # prints 1
@n return type of : int
- 戻り値
- 次のエンティティの整数 ID: Entity.