|
Cubit Python API 2026.6
|
Loading...
Searching...
No Matches
The base class of all the geometry and mesh types. More...
Inheritance diagram for Entity:
Public Member Functions | |
| bounding_box (self) | |
| Returns the axis-aligned bounding box of the Entity. | |
| center_point (self) | |
| Returns the geometric center point of the Entity. | |
| id (self) | |
| Retrieves the unique identifier of the Entity. | |
Detailed Description
The base class of all the geometry and mesh types.
.. code-block:: python
import cubit
br = cubit.brick(1,1,1)
cubit.scale(br,2)
cubit.cmd('delete body 1')
cmd(input_string)
Execute a raw Cubit command string immediately (modifies model state).
Definition cubit.py:5275
scale(entity, factor, preview=False)
Scales an Entity uniformly by a specified factor.
Definition cubit.py:24964
brick(width, depth=-1, height=-1)
Create a brick of specified width, depth, and height.
Definition cubit.py:24090
Member Function Documentation
◆ bounding_box()
| bounding_box | ( | self | ) |
Returns the axis-aligned bounding box of the Entity.
Computes the minimum and maximum coordinates of the Entityxs geometry in X, Y, and Z directions.
.. 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]
sphere(radius, x_cut=0, y_cut=0, z_cut=0, inner_radius=0)
Create all or part of a sphere.
Definition cubit.py:24145
@n return type of : std:: array< double,6 >
- Returns
- : An array (or list) of six values minX, minY, minZ, maxX, maxY, maxZ.
◆ center_point()
| center_point | ( | self | ) |
Returns the geometric center point of the Entity.
Computes the centroid of the Entityxs geometry based on its current position.
.. 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)
move(entity, vector, preview=False)
Translates an Entity by a specified vector.
Definition cubit.py:24931
@n return type of : std:: array< double,3 >
- Returns
- : An array (or list) of three values x, y, and z coordinates of the Entityxs center.
◆ id()
| id | ( | self | ) |
Retrieves the unique identifier of the Entity.
Returns the integer ID assigned to the Entity upon creation.
.. 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
- Returns
- The integer ID of the Entity.
Generated on Tue Jun 9 2026 13:00:43 for Cubit Python API by