Cubit Python API  17.10

基本クラスは、具体的にジオメトリタイプ(Body , Surface など) 詳細...

GeomEntity の遺産グラフ:
Entity Body Curve Surface Vertex Volume

公開メンバ関数

def  bodies (self)
  ジオメトリのエンティティに含まれるボディを取り戻す。 詳細...

 
def  カーブ (self)
  Retrieve カーブ (エッジ) 関連するジオメトリエンティティ. 詳細...

 
def  dimension (self)
  ジオメトリのエンティティのトポロジーの次元を得る。 詳細...

 
def  entity_name (self)
  ジオメトリのエンティティの主な名前を取り戻す。 詳細...

 
def  entity_names (self)
  ジオメトリのエンティティに割り当てられたすべての名前を返します。 詳細...

 
def  is_meshed (self)
  現在のメッシュの状態を回復する。 GeomEntity. 詳細...

 
def  is_transparent (self)
  ジオメトリのエンティティの透明性の状態を得る。 詳細...

 
def  is_visible (self)
  ジオメトリのエンティティの視覚状態を取得します。 詳細...

 
def  mesh (self)
  メッシュを生成するA GeomEntity メッシングの状態を確認する。 詳細...

 
def  num_names (self)
  ジオメトリのエンティティに割り当てられた名前の数を取得します。 詳細...

 
def  remove_entity_name (self, name)
  ジオメトリのエンティティから特定の名前を削除します。 詳細...

 
def  remove_entity_names (self)
  ジオメトリのエンティティからすべての非デフォルト名を削除します。 詳細...

 
def  remove_mesh (self)
  ジオメトリのエンティティに関連するメッシュを削除します。 詳細...

 
def  set_entity_name (self, name)
  ジオメトリのエンティティに名前を付けます。 詳細...

 
def  set_transparent (self, transparency_flag)
  ジオメトリのエンティティの透明性状態を設定します。 詳細...

 
def  set_visible (self, visibility_flag)
  ジオメトリのエンティティの可視性状態を設定して確認します。 詳細...

 
def  smooth (self)
  メッシュを「A」に GeomEntity 「要素品質」を向上させる 詳細...

 
def  サーフェス (self)
  Retrieve サーフェス関連するジオメトリエンティティ。 詳細...

 
def  頂点 (self)
  「頂点」(ポイント)をジオメトリのエンティティと関連付けます。 詳細...

 
def  ボリューム (self)
  ジオメトリのエンティティと関連するボリュームを取り戻す。 詳細...

 
- 継承された公開メンバ関数 Entity
def  bounding_box (self)
  次のエンティティの軸平行バウンディングボックスを返します: Entity. 詳細...

 
def  center_point (self)
  次のエンティティの幾何学的中心点を返します: Entity. 詳細...

 
def  id (self)
  次のエンティティの一意な識別子を取得します: Entity. 詳細...

 

詳細説明

基本クラスは、具体的にジオメトリタイプ(Body , Surface など)

メンバ関数ドキュメント

◆ bodies()

def bodies (   self )

ジオメトリのエンティティに含まれるボディを取り戻す。

リストを返す Body これに関連する物件 GeomEntity 例えば、ボディからサーフェスまたはボリュームからボディを表します。

         .. code-block:: python
# Create a 2D rectangular sheet via a Cubit command
cubit.cmd ("create surface rectangle width 1" )
# Get the surface entity by its ID
surf = cubit.surface (1)
# Retrieve sheet bodies associated with this surface
bodies = surf.bodies()
print("Number of bodies:" , len(bodies)) # Expected output: 1
        @n return type of : std::vector< CubitInterface::Body,std::allocator< CubitInterface:: Body > >
戻り値
ベクトル(リスト) Body 内部に含まれる物体 GeomEntity.

◆ curves()

def curves (   self )

Retrieve カーブ (エッジ) 関連するジオメトリエンティティ.

リストを返す Curve これを結びつける物体 GeomEntity 例えば、ブリックのエッジ、あるいはサーフェスの境界のカーブなど。

         .. code-block:: python
# Create a brick which has edges as curves
b = cubit.brick (1)
# Retrieve all curves (edges) of the brick
curves = b.curves()
print("Number of curves:" , len(curves)) # Expected output: 12
# Access the first curve and query its dimension
c = curves[0]
print("Curve dimension:" , c.dimension()) # Expected output: 1
        @n return type of : std::vector< CubitInterface::Curve,std::allocator< CubitInterface:: Curve > >
戻り値
ベクトル(リスト) Curve これに関連する物件 GeomEntity.

◆ dimension()

def dimension (   self )

ジオメトリのエンティティのトポロジーの次元を得る。

次元を返す(0 for) Vertex 1 のために Curve 2 のために Surface , 3 for ボリューム/ ボディ) of this GeomEntity .

         .. code-block:: python
# Create a brick and query its dimension
b = cubit.brick (1)
print("Body dimension:" , b.dimension()) # Expected output: 3
# Create a cylinder and query its dimension
cyl = cubit.cylinder (0.5, 2.0)
print("Cylinder dimension:" , cyl.dimension()) # Expected output: 3
# Retrieve boundary curves of the cylinder and query their dimensions
curves = cyl.curves()

for c in curves: print("Curve dimension:", c.dimension()) # Expected output: 1

         @n return type of :  int
戻り値
トポロジーの次元について GeomEntity 0×3です。

◆ entity_name()

def entity_name (   self )

ジオメトリのエンティティの主な名前を取り戻す。

これに与えられた最初の名前を返します。 GeomEntity 識別とラベル化に役立つ。

         .. code-block:: python
# Create a brick, set its name, and retrieve it
b = cubit.brick (1)
b.set_entity_name("MyBrick" )
name = b.entity_name()
print("Entity name:" , name)
        @n return type of :  string
戻り値
最初の名前は、 GeomEntity.

◆ entity_names()

def entity_names (   self )

ジオメトリのエンティティに割り当てられたすべての名前を返します。

これに割り当てられたすべての名前のリストを返します。 GeomEntity 同盟のリストまたは以前の識別を可能にする。

         .. code-block:: python
# Create a brick, assign two names, and list them
b = cubit.brick (1)
b.set_entity_name("BrickA" )
b.set_entity_name("PrimaryBrick" )
names = b.entity_names()

for n in names: print("Name:", n)

         @n return type of : std::vector< std::string,std::allocator< std:: string > >
戻り値
すべての名前のベクトル(リスト) GeomEntity.

◆ is_meshed()

def is_meshed (   self )

現在のメッシュの状態を回復する。 GeomEntity .

表明するか、その GeomEntity メッシュの要素が定義されています。

         .. code-block:: python
# Create and mesh a 10x10x10 brick
b = cubit.brick (10.0, 10.0, 10.0)
b.mesh()
# Check mesh state
meshed = b.is_meshed()
print("Meshed:" , meshed) # prints True
        @n return type of :  boolean
戻り値
真実なら、その GeomEntity 偽り、偽りとは違う。

◆ is_transparent()

def is_transparent (   self )

ジオメトリのエンティティの透明性の状態を得る。

これが戻ってくるかどうか GeomEntity 現在は透明( 1 あるいは不明( 0 ).

         .. code-block:: python
# Create a brick and query default transparency
b = cubit.brick (1)
print("Is brick transparent?" , b.is_transparent()) # Expected output: 1
        @n return type of :  int
戻り値
現在の透明性は、 GeomEntity ( 1 透明なら、 0 間違っている場合)

◆ is_visible()

def is_visible (   self )

ジオメトリのエンティティの視覚状態を取得します。

これが戻ってくるかどうか GeomEntity 現時点ではビューポート(1)または隠された(0)に表示されます。

         .. code-block:: python
# Create a brick and hide it
b = cubit.brick (1)
b.set_visible(False )
# Query visibility state
vis = b.is_visible()
print("Is brick visible?" , vis) # Expected output: False
        @n return type of :  int
戻り値
現在の視覚状態は、 GeomEntity (見た場合 0 隠された場合)

◆ mesh()

def mesh (   self )

メッシュを生成するA GeomEntity メッシングの状態を確認する。

データのジオメトリを差別する GeomEntity (例: サーフェス、ボリューム)をメッシュ要素に変換します。使用: is_meshed メッシングがエンティティで行われたかどうかを確認する。

         .. code-block:: python
# Create a 10x10x10 brick
b = cubit.brick (10.0, 10.0, 10.0)
# Generate mesh on the volume
b.mesh()
# Verify that meshing has occurred
meshed = b.is_meshed()
print("Mesh generated:" , meshed) # prints True

◆ num_names()

def num_names (   self )

ジオメトリのエンティティに割り当てられた名前の数を取得します。

これに現在割り当てられた名前の数を返します。 GeomEntity アライアスやアイデンティティを追跡するために。

         .. code-block:: python
# Create a brick, assign two names, and get the name count
b = cubit.brick (1)
b.set_entity_name("BrickA" )
b.set_entity_name("PrimaryBrick" )
count = b.num_names()
print("Name count:" , count)
        @n return type of :  int
戻り値
名前の数名前の数 GeomEntity.

◆ remove_entity_name()

def remove_entity_name (   self,
  name 
)

ジオメトリのエンティティから特定の名前を削除します。

これまでに割り当てられた名前の一つを削除します。 GeomEntity 他の名前を保存する。

         .. code-block:: python
# Create a brick, assign two names, remove one, and list remaining names
b = cubit.brick (1)
b.set_entity_name("BrickA" )
b.set_entity_name("PrimaryBrick" )
# Remove the first assigned name
b.remove_entity_name("BrickA" )
# Verify remaining names
names = b.entity_names()

for n in names: print("Remaining name:", n)

         @n type of name:  string, in
パラメータ
name これから取り除くための特定の名称 GeomEntity.

◆ remove_entity_names()

def remove_entity_names (   self )

ジオメトリのエンティティからすべての非デフォルト名を削除します。

これに割り当てられたすべての名称を削除します。 GeomEntity 既存のデフォルト名を保存する。

         .. code-block:: python
# Create a brick, assign two custom names, then remove them and verify
b = cubit.brick (1)
b.set_entity_name("BrickA" )
b.set_entity_name("PrimaryBrick" )
# Initial name count (default + 2 custom names)
print("Before removal, name count:" , b.num_names())
# Expected output: 3
# Remove all custom names
b.remove_entity_names()
# Verify only default name remains
print("After removal, name count:" , b.num_names())
# Expected output: 1

◆ remove_mesh()

def remove_mesh (   self )

ジオメトリのエンティティに関連するメッシュを削除します。

メッシュを削除するA GeomEntity

         .. code-block:: python
# Create a brick and mesh it
b = cubit.brick (1)
b.mesh()
# Check the number of hexes that were created
print("Hex count:" , cubit.get_hex_count ())
# Delete the mesh on the brick
b.remove_mesh()
# Check that the number of elements is 0
print("Hex count:" , cubit.get_hex_count ())

◆ set_entity_name()

def set_entity_name (   self,
  name 
)

ジオメトリのエンティティに名前を付けます。

その主な名称を指定する。 GeomEntity アイデンティティとラベル化

         .. code-block:: python
# Create a brick and set its name
b = cubit.brick (1)
b.set_entity_name("Brick1" )
# Retrieve and print the assigned name
name = b.entity_name()
print("Entity name:" , name)
        @n type of name:  string, in
パラメータ
name 名称に割り当てられる。 GeomEntity.

◆ set_transparent()

def set_transparent (   self,
  transparency_flag 
)

ジオメトリのエンティティの透明性状態を設定します。

これがどうなっているのか、疑問です。 GeomEntity 透明性をもって提供される。 通過 1 makes it transparent; 0 それを曖昧にする。 創造の状態は透明である。

         .. code-block:: python
# Create a brick (default is transparent)
b = cubit.brick (1)
# Turn transparency off
b.set_transparent(0)
print("Is brick transparent?" , b.is_transparent()) # Expected output: 0
# Turn transparency back on
b.set_transparent(1)
print("Is brick transparent?" , b.is_transparent()) # Expected output: 1
        @n type of transparency_flag:  int, in
パラメータ
transparency_flag 国旗( 1 透明に、 0 透明性(透明性)の状態を設定する。

◆ set_visible()

def set_visible (   self,
  visibility_flag 
)

ジオメトリのエンティティの可視性状態を設定して確認します。

これがどうなっているのか、疑問です。 GeomEntity ビジョンポートに表示される。 通過 true makes it visible; false それを隠す。 利用 is_visible() 現在の国を問うこと。

         .. code-block:: python
# Create a brick
b = cubit.brick (1)
# Hide the brick and verify
b.set_visible(False )
print("Is brick visible?" , b.is_visible()) # Expected output: False
# Show the brick and re-verify
b.set_visible(True )
print("Is brick visible?" , b.is_visible()) # Expected output: True
        @n type of visibility_flag:  boolean, in
パラメータ
visibility_flag 国旗は、その国旗が Entity 見た目( true(あるいは隠されたもの) false).

◆ smooth()

def smooth (   self )

メッシュを「A」に GeomEntity 「要素品質」を向上させる

メッシュのスムージングを既存のメッシュに適用 GeomEntity 。エンティティがすでにメッシュ生成されている必要があります( is_meshed() (真実に戻る) スムージングの方法は、現在 geomEntity に設定されているスキームに基づいています。 ラプラシアン、メイン比率など。

         .. code-block:: python
# create a sphere with radius 1
sphere_body = cubit.sphere (1)
# get the surface from the sphere body
sphere_surf = sphere_body.surfaces()[0]
# set the meshing scheme to trimesh
cubit.cmd (f"surface {sphere_surf.id()} scheme trimesh" )
# set the smoothing scheme to mean ratio
cubit.cmd (f"surface {sphere_surf.id()} smooth scheme mean ratio" )
# mesh the surface with triangles
sphere_surf.mesh()
# check the quality and display the result
cubit.cmd ("quality surf all draw mesh" )
# smooth the surface mesh
sphere_surf.smooth()
# display the new quality after smoothing
cubit.cmd ("quality surf all draw mesh" )

◆ surfaces()

def surfaces (   self )

Retrieve サーフェス関連するジオメトリエンティティ。

リストを返す Surface これを結びつける物体 GeomEntity まるでブリッジの顔のようだ。

         .. code-block:: python
# Create a brick which generates a volume
b = cubit.brick (1)
# Retrieve boundary surfaces from the body
surfaces = b.surfaces()
print("Number of surfaces:" , len(surfaces)) # Expected output: 6
# Access the first surface and query its dimension
s = surfaces[0]
print("Surface dimension:" , s.dimension()) # Expected output: 2
        @n return type of : std::vector< CubitInterface::Surface,std::allocator< CubitInterface:: Surface > >
戻り値
ベクトル(リスト) Surface これに関連する物件 GeomEntity.

◆ vertices()

def vertices (   self )

「頂点」(ポイント)をジオメトリのエンティティと関連付けます。

リストを返す Vertex これを結びつける物体 GeomEntity たとえば、ブリックの角のように。

         .. code-block:: python
# Create a brick which generates a volume
b = cubit.brick (1)
# Retrieve vertices from the body
vertices = b.vertices()
print("Number of vertices:" , len(vertices)) # Expected output: 8
# Access the first vertex and query its dimension
v = vertices[0]
print("Vertex dimension:" , v.dimension()) # Expected output: 0
        @n return type of : std::vector< CubitInterface::Vertex,std::allocator< CubitInterface:: Vertex > >
戻り値
ベクトル(リスト) Vertex これに関連する物件 GeomEntity.

◆ volumes()

def volumes (   self )

ジオメトリのエンティティと関連するボリュームを取り戻す。

リストを返す Volume これに関連する物件 GeomEntity 例えば、ブリックによって作られたボリュームなど。

         .. code-block:: python
# Create a brick which generates a volume
b = cubit.brick (1)
# Retrieve volumes from the body
volumes = b.volumes()
print("Number of volumes:" , len(volumes)) # Expected output: 1
# Access the first volume and query its dimension
vol = volumes[0]
print("Volume dimension:" , vol.dimension()) # Expected output: 3
        @n return type of : std::vector< CubitInterface::Volume,std::allocator< CubitInterface:: Volume > >
戻り値
ベクトル(リスト) Volume これに関連する物件 GeomEntity.