pycanha_core.gmm — Core Geometric Classes#
These are the C++ geometric primitive and mesh classes.
Enumerations#
Primitives#
- class pycanha_core.gmm.Primitive#
Bases:
objectBase class for geometric primitives.
- __init__(*args, **kwargs)#
- distance(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) float#
Signed distance from a point to the surface.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
Distance Jacobian w.r.t. the cutted surface parameters.
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
Distance Jacobian w.r.t. the cutting surface parameters.
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Map a 2D parametric point to 3D space.
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
Project a 3D point onto the 2D parametric space.
- class pycanha_core.gmm.Triangle(*args, **kwargs)#
Bases:
PrimitiveTriangular flat surface defined by three 3D vertices.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C']) None#
Create a triangle from three 3D vertex positions.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
First vertex position.
- property p2#
Second vertex position.
- property p3#
Third vertex position.
- v1(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p2 - p1.
- v2(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p3 - p1.
- class pycanha_core.gmm.Rectangle(*args, **kwargs)#
Bases:
PrimitiveRectangular flat surface defined by three vertices.
The fourth vertex is derived automatically. p1-p2 defines one edge, p1-p3 the adjacent edge.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C']) None#
Create a rectangle from three corner positions.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
Origin vertex position.
- property p2#
Second vertex (defines first edge from p1).
- property p3#
Third vertex (defines second edge from p1).
- v1(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p2 - p1.
- v2(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p3 - p2.
- class pycanha_core.gmm.Quadrilateral(*args, **kwargs)#
Bases:
PrimitiveGeneral quadrilateral surface defined by four vertices (may be non-planar).
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C'], p4: numpy.ndarray[dtype=float64, shape=(3), order='C']) None#
Create a quadrilateral from four 3D vertex positions.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
First vertex position.
- property p2#
Second vertex position.
- property p3#
Third vertex position.
- property p4#
Fourth vertex position.
- v1(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p2 - p1.
- v2(self) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Edge vector p3 - p2.
- class pycanha_core.gmm.Cylinder(*args, **kwargs)#
Bases:
PrimitiveCylindrical surface segment defined by axis, radius, and angular extent.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C'], radius: float, start_angle: float, end_angle: float) None#
Create a cylinder from axis points, reference, radius, and angles.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- property end_angle#
End angle [rad].
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
Base center position.
- property p2#
Top center position.
- property p3#
Reference point for angle origin.
- property radius#
Cylinder radius.
- property start_angle#
Start angle [rad].
- class pycanha_core.gmm.Disc(*args, **kwargs)#
Bases:
PrimitiveAnnular disc (flat ring) surface segment defined by center, normal, inner/outer radii, and angular extent.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C'], inner_radius: float, outer_radius: float, start_angle: float, end_angle: float) None#
Create a disc from center, normal ref, radii, and angles.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- property end_angle#
End angle [rad].
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property inner_radius#
Inner radius (0 for a full disc).
- property outer_radius#
Outer radius.
- property p1#
Center position.
- property p2#
Normal direction reference point.
- property p3#
Reference point for angle origin.
- property start_angle#
Start angle [rad].
- class pycanha_core.gmm.Cone(*args, **kwargs)#
Bases:
PrimitiveConical (frustum) surface segment defined by axis, two radii, and angular extent.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C'], radius1: float, radius2: float, start_angle: float, end_angle: float) None#
Create a cone from axis points, reference, radii, and angles.
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- property end_angle#
End angle [rad].
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
Base center position.
- property p2#
Top center position.
- property p3#
Reference point for angle origin.
- property radius1#
Radius at the base (p1 end).
- property radius2#
Radius at the top (p2 end).
- property start_angle#
Start angle [rad].
- class pycanha_core.gmm.Sphere(*args, **kwargs)#
Bases:
PrimitiveSpherical surface segment with optional truncation at base and apex, and angular extent control.
- __init__(self, p1: numpy.ndarray[dtype=float64, shape=(3), order='C'], p2: numpy.ndarray[dtype=float64, shape=(3), order='C'], p3: numpy.ndarray[dtype=float64, shape=(3), order='C'], radius: float, base_truncation: float, apex_truncation: float, start_angle: float, end_angle: float) None#
Create a sphere segment from center, axis, reference, radius, truncation fractions, and angular extent.
- property apex_truncation#
Apex truncation fraction (0 = no truncation).
- property base_truncation#
Base truncation fraction (0 = no truncation).
- create_mesh(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh of this primitive.
- create_mesh2(self, arg0: pycanha_core.pycanha_core.gmm.ThermalMesh, arg1: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Create a triangular mesh (alternative algorithm).
- distance_jacobian_cutted_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- distance_jacobian_cutting_surface(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) std::array<double, 4ul>#
- property end_angle#
End angle [rad].
- from_2d_to_3d(self, p2d: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
- from_3d_to_2d(self, p3d: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
- property p1#
Center position.
- property p2#
Axis direction reference point.
- property p3#
Reference point for angle origin.
- property radius#
Sphere radius.
- property start_angle#
Start angle [rad].
Meshes#
- class pycanha_core.gmm.ThermalMesh(*args, **kwargs)#
Bases:
objectThermal and mesh properties for a geometry surface.
Defines two-sided surface properties (activity, thickness, color, bulk material, optical material) and mesh discretization in two parametric directions.
- property dir1_mesh#
Mesh division points in direction 1 (list from 0 to 1).
- property dir2_mesh#
Mesh division points in direction 2 (list from 0 to 1).
- property side1_activity#
Whether side 1 is thermally active.
- property side1_color#
RGB color of side 1.
- property side1_material#
Bulk material (density, specific heat, conductivity) of side 1.
- property side1_optical#
Optical material (emissivity/absorptivity) of side 1.
- property side1_thick#
Thickness of side 1.
- property side2_activity#
Whether side 2 is thermally active.
- property side2_color#
RGB color of side 2.
- property side2_material#
Bulk material (density, specific heat, conductivity) of side 2.
- property side2_optical#
Optical material (emissivity/absorptivity) of side 2.
- property side2_thick#
Thickness of side 2.
- class pycanha_core.gmm.TriMesh(*args, **kwargs)#
Bases:
objectTriangulated surface mesh storing vertices, triangles, face IDs, edges, and per-surface colors.
- __init__(self, arg0: numpy.ndarray[dtype=float64, shape=(*, 3), order='F'], arg1: numpy.ndarray[dtype=uint32, shape=(*, 3), order='F'], arg2: numpy.ndarray[dtype=uint32, shape=(*), order='C'], arg3: collections.abc.Sequence[numpy.ndarray[dtype=uint32, shape=(*), order='C']], arg4: numpy.ndarray[dtype=uint32, shape=(*), order='C'], arg5: collections.abc.Sequence[numpy.ndarray[dtype=uint32, shape=(*), order='C']], /) None#
Create a TriMesh from all mesh data arrays.
- property edges#
Edge list (vertex index pairs).
- property face_ids#
Face ID per triangle.
- property faces_edges#
Edges grouped by face.
- get_edges(self) list[numpy.ndarray[dtype=uint32, shape=(*), order='C']]#
Get the edge list (vertex index pairs).
- get_face_ids(self) numpy.ndarray[dtype=uint32, shape=(*), order='C']#
Get the face ID array.
- get_faces_edges(self) list[numpy.ndarray[dtype=uint32, shape=(*), order='C']]#
Get edges grouped by face.
- get_perimeter_edges(self) numpy.ndarray[dtype=uint32, shape=(*), order='C']#
Get the perimeter edge indices.
- get_triangles(self) numpy.ndarray[dtype=uint32, shape=(*, *), writable=False]#
Get triangle vertex indices as a numpy array (Nt x 3).
- get_vertices(self) numpy.ndarray[dtype=float64, shape=(*, *), writable=False]#
Get vertex coordinates as a numpy array (Nv x 3).
- property perimeter_edges#
Perimeter edge indices.
- set_edges(self, arg: collections.abc.Sequence[numpy.ndarray[dtype=uint32, shape=(*), order='C']], /) None#
Set the edge list.
- set_face_ids(self, arg: numpy.ndarray[dtype=uint32, shape=(*), order='C'], /) None#
Set the face ID for each triangle.
- set_faces_edges(self, arg: collections.abc.Sequence[numpy.ndarray[dtype=uint32, shape=(*), order='C']], /) None#
Set edges grouped by face.
- set_perimeter_edges(self, arg: numpy.ndarray[dtype=uint32, shape=(*), order='C'], /) None#
Set the perimeter edge indices.
- property surface1_color#
RGB color of surface side 1.
- property surface2_color#
RGB color of surface side 2.
- property triangles#
Triangle vertex indices (Nt x 3).
- property vertices#
Vertex coordinates (Nv x 3).
- class pycanha_core.gmm.TriMeshModel(*args, **kwargs)#
Bases:
objectCompacted triangle mesh aggregating all geometry items into a single cache-friendly structure for rendering and ray-tracing.
- add_mesh(self, arg0: pycanha_core.pycanha_core.gmm.TriMesh, arg1: int, /) None#
Append a TriMesh to the unified model.
- property back_colors#
Back-side RGB colors per geometry.
- property edges#
All edge vertex index pairs.
- property face_activity#
Face activity flags (-1=inactive, 0=both, 1/2=one side).
- property face_ids#
Face index per triangle.
- property faces_edges#
Edges grouped by face.
- property front_colors#
Front-side RGB colors per geometry.
- property geometries_edges#
Edge index ranges per geometry (Ng+1).
- property geometries_id#
Unique ID per geometry.
- property geometries_perimeter_edges#
Perimeter edge index ranges per geometry (Ng+1).
- property geometries_triangles#
Triangle index ranges per geometry (Ng+1).
- property geometries_vertices#
Vertex index ranges per geometry (Ng+1).
- get_geometry_mesh(self, arg: int, /) pycanha_core.pycanha_core.gmm.TriMesh#
Extract a TriMesh for a single geometry by index.
- property n_faces#
Total number of distinct faces.
- property n_geometries#
Number of geometry items in the model.
- property opticals#
Optical properties per face (Nf x 6).
- property perimeter_edges#
All perimeter edge vertex index pairs.
- property triangles#
All triangle vertex indices (Nt x 3).
- property vertices#
All vertex coordinates (Nv x 3, float).
Transformations#
- class pycanha_core.gmm.CoordinateTransformation(*args, **kwargs)#
Bases:
object3D coordinate transformation combining translation and rotation, with configurable application order.
- __init__(self) None#
- __init__(self, translation: numpy.ndarray[dtype = float64, shape=(3), order='C'] = array([0., 0., 0.]), rotation: numpy.ndarray[dtype = float64, shape=(3), order='C'] = array([0., 0., 0.]), order: pycanha_core.pycanha_core.gmm.TransformOrder = TransformOrder.TRANSLATION_THEN_ROTATION) None
Overloaded function.
__init__(self) -> None
Create an identity transformation.
__init__(self, translation: numpy.ndarray[dtype=float64, shape=(3), order='C'] = array([0., 0., 0.]), rotation: numpy.ndarray[dtype=float64, shape=(3), order='C'] = array([0., 0., 0.]), order: pycanha_core.pycanha_core.gmm.TransformOrder = TransformOrder.TRANSLATION_THEN_ROTATION) -> None
Create a transformation from translation vector, rotation angles (XYZ Euler), and application order.
- property order#
Order of translation and rotation operations.
- property rotation#
3x3 rotation matrix.
- transform_point(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Apply the transformation to a 3D point.
- property translation#
Translation vector [x, y, z].
Geometry hierarchy#
- class pycanha_core.gmm.Geometry(*args, **kwargs)#
Bases:
objectBase class for all geometry elements.
Each geometry has a unique ID, a name, an optional coordinate transformation, and an optional parent group.
- __init__(self) None#
- __init__(self, name: str) None
- __init__(self, name: str, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) None
Overloaded function.
__init__(self) -> None
Create a geometry with auto-generated name.
__init__(self, name: str) -> None
Create a geometry with the given name.
__init__(self, name: str, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) -> None
Create a geometry with name and transformation.
- property name#
Geometry name.
- property parent#
Parent GeometryGroup (weak reference).
- property transformation#
Coordinate transformation applied to this geometry.
- class pycanha_core.gmm.GeometryItem(*args, **kwargs)#
Bases:
GeometryGeometry element holding a single Primitive.
- __init__(self) None#
- __init__(self, name: str, primitive: pycanha_core.pycanha_core.gmm.Primitive, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) None
Overloaded function.
__init__(self) -> None
Create an empty geometry item.
__init__(self, name: str, primitive: pycanha_core.pycanha_core.gmm.Primitive, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) -> None
Create a geometry item with a primitive and transformation.
- property name#
Geometry name.
- property parent#
Parent GeometryGroup (weak reference).
- property primitive#
The geometric Primitive of this item.
- property transformation#
Coordinate transformation applied to this geometry.
- class pycanha_core.gmm.GeometryMeshedItem(*args, **kwargs)#
Bases:
GeometryItemGeometry item with thermal mesh properties and a generated triangle mesh.
- __init__(self) None#
- __init__(self, name: str, primitive: pycanha_core.pycanha_core.gmm.Primitive, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation, thermal_mesh: pycanha_core.pycanha_core.gmm.ThermalMesh) None
Overloaded function.
__init__(self) -> None
Create an empty meshed geometry item.
__init__(self, name: str, primitive: pycanha_core.pycanha_core.gmm.Primitive, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation, thermal_mesh: pycanha_core.pycanha_core.gmm.ThermalMesh) -> None
Create a meshed item with primitive, transform, and thermal mesh.
- property name#
Geometry name.
- property parent#
Parent GeometryGroup (weak reference).
- property primitive#
The geometric Primitive of this item.
- property thermal_mesh#
ThermalMesh defining surface properties and mesh divisions.
- property transformation#
Coordinate transformation applied to this geometry.
- property tri_mesh#
Generated TriMesh (triangle mesh data).
- class pycanha_core.gmm.GeometryGroup(*args, **kwargs)#
Bases:
GeometryHierarchical container of GeometryMeshedItems, sub-groups, and cutted groups. Applies a shared transformation to all children.
- __init__(self) None#
- __init__(self, name: str) None
- __init__(self, name: str, geometry_items: collections.abc.Sequence[pycanha_core.pycanha_core.gmm.GeometryMeshedItem | pycanha_core.pycanha_core.gmm.GeometryGroup | pycanha_core.pycanha_core.gmm.GeometryGroupCutted], transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) None
Overloaded function.
__init__(self) -> None
Create an empty geometry group.
__init__(self, name: str) -> None
Create a geometry group with the given name.
__init__(self, name: str, geometry_items: collections.abc.Sequence[pycanha_core.pycanha_core.gmm.GeometryMeshedItem | pycanha_core.pycanha_core.gmm.GeometryGroup | pycanha_core.pycanha_core.gmm.GeometryGroupCutted], transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) -> None
Create a group with items and a shared transformation.
- add_geometry_group(self, arg: pycanha_core.pycanha_core.gmm.GeometryGroup, /) None#
Add a child GeometryGroup.
- add_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryMeshedItem, /) None#
Add a GeometryMeshedItem to this group.
- property geometry_groups#
List of child GeometryGroups.
- property geometry_groups_cutted#
List of child GeometryGroupCutted objects.
- property geometry_items#
List of child GeometryMeshedItems.
- property name#
Geometry name.
- property parent#
Parent GeometryGroup (weak reference).
- remove_geometry_group(self, arg: pycanha_core.pycanha_core.gmm.GeometryGroup, /) None#
Remove a child GeometryGroup.
- remove_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryItem, /) None#
Remove a GeometryMeshedItem from this group.
- property transformation#
Coordinate transformation applied to this geometry.
- class pycanha_core.gmm.GeometryGroupCutted#
Bases:
GeometryGroupGeometry group where child meshes are cut by cutting primitives (boolean subtraction).
- __init__(*args, **kwargs)#
- add_cutting_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryItem, /) None#
Add a geometry item as a cutting tool.
- add_geometry_group(self, arg: pycanha_core.pycanha_core.gmm.GeometryGroup, /) None#
Add a child GeometryGroup.
- add_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryMeshedItem, /) None#
Add a GeometryMeshedItem to this group.
- create_cutted_mesh(self, arg: float, /) None#
Perform the cutting operation and generate cut meshes.
- property cutted_geometry_meshed_items#
List of resulting cut GeometryMeshedItems.
- property cutting_geometry_items#
List of geometry items used as cutting tools.
- property geometry_groups#
List of child GeometryGroups.
- property geometry_groups_cutted#
List of child GeometryGroupCutted objects.
- property geometry_items#
List of child GeometryMeshedItems.
- property name#
Geometry name.
- property parent#
Parent GeometryGroup (weak reference).
- remove_cutting_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryItem, /) None#
Remove a cutting geometry item.
- remove_geometry_group(self, arg: pycanha_core.pycanha_core.gmm.GeometryGroup, /) None#
Remove a child GeometryGroup.
- remove_geometry_item(self, arg: pycanha_core.pycanha_core.gmm.GeometryItem, /) None#
Remove a GeometryMeshedItem from this group.
- property transformation#
Coordinate transformation applied to this geometry.
- class pycanha_core.gmm.GeometryModel(*args, **kwargs)#
Bases:
objectTop-level container for the complete geometry model.
Manages a hierarchy of geometry items and groups, provides factory methods for creating them, and generates the unified TriMeshModel for analysis.
- __init__(self) None#
- __init__(self, name: str) None
Overloaded function.
__init__(self) -> None
Create an empty geometry model.
__init__(self, name: str) -> None
Create a geometry model with the given name.
- create_geometry_group(self, name: str, geometries: collections.abc.Sequence[pycanha_core.pycanha_core.gmm.GeometryMeshedItem | pycanha_core.pycanha_core.gmm.GeometryGroup | pycanha_core.pycanha_core.gmm.GeometryGroupCutted], transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) pycanha_core.pycanha_core.gmm.GeometryGroup#
Create and register a GeometryGroup.
- create_geometry_group_cutted(self, name: str, geometries: collections.abc.Sequence[pycanha_core.pycanha_core.gmm.GeometryMeshedItem | pycanha_core.pycanha_core.gmm.GeometryGroup | pycanha_core.pycanha_core.gmm.GeometryGroupCutted], cutting_geometry_items: collections.abc.Sequence[pycanha_core.pycanha_core.gmm.GeometryItem], transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation) pycanha_core.pycanha_core.gmm.GeometryGroup#
Create and register a GeometryGroupCutted.
- create_geometry_item(self, name: str, primitive: pycanha_core.pycanha_core.gmm.Primitive, transformation: pycanha_core.pycanha_core.gmm.CoordinateTransformation, thermal_mesh: pycanha_core.pycanha_core.gmm.ThermalMesh) pycanha_core.pycanha_core.gmm.GeometryMeshedItem#
Create and register a GeometryMeshedItem.
- get_root_geometry_group(self) pycanha_core.pycanha_core.gmm.GeometryGroup#
Get the root GeometryGroup of the hierarchy.
- get_trimesh_model(self) pycanha_core.pycanha_core.gmm.TriMeshModel#
Get the unified TriMeshModel for rendering/analysis.
Mesh utility functions#
- pycanha_core.gmm.cdt_trimesher(trimesh: pycanha_core.pycanha_core.gmm.TriMesh) None#
Refine a TriMesh using constrained Delaunay triangulation.
- pycanha_core.gmm.create_2d_rectangular_mesh(arg0: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg1: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg2: float, arg3: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Generate a 2D rectangular mesh.
- pycanha_core.gmm.create_2d_quadrilateral_mesh(arg0: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg1: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg2: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg3: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg4: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg5: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg6: float, arg7: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Generate a 2D quadrilateral mesh.
- pycanha_core.gmm.create_2d_triangular_mesh(arg0: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg1: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg2: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg3: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg4: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg5: float, arg6: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Generate a 2D triangular mesh.
- pycanha_core.gmm.create_2d_triangular_only_mesh(arg0: numpy.ndarray[dtype=float64, shape=(*), order='C'], arg1: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg2: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg3: numpy.ndarray[dtype=float64, shape=(2), order='C'], arg4: float, arg5: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Generate a 2D mesh with triangles only.