pycanha_core.gmm — Geometry and Mesh Classes#
The gmm submodule exposes the geometric primitives, meshes, and scene graph
types used by the thermal model.
Primitives#
- class Primitive#
Bases:
objectBase class for geometric primitives.
- __init__(*args, **kwargs)#
- distance#
Signed distance from a point to the surface.
- distance_jacobian_cutted_surface#
Distance Jacobian w.r.t. the cutted surface parameters.
- distance_jacobian_cutting_surface#
Distance Jacobian w.r.t. the cutting surface parameters.
- from_2d_to_3d#
Map a 2D parametric point to 3D space.
- from_3d_to_2d#
Project a 3D point onto the 2D parametric space.
- is_valid#
Check whether the primitive geometry is valid.
- class Triangle(*args, **kwargs)#
Bases:
PrimitiveTriangle defined by three vertices.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- v1#
Edge vector p2 - p1.
- v2#
Edge vector p3 - p1.
- class Rectangle(*args, **kwargs)#
Bases:
PrimitiveRectangle defined by three vertices.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- v1#
Edge vector p2 - p1.
- v2#
Edge vector p3 - p2.
- class Quadrilateral(*args, **kwargs)#
Bases:
PrimitiveQuadrilateral defined by four vertices.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p4#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- v1#
Edge vector p2 - p1.
- v2#
Edge vector p3 - p2.
- class Cylinder(*args, **kwargs)#
Bases:
PrimitiveCylindrical surface segment.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- property end_angle#
(self) -> float
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property radius#
(self) -> float
- property start_angle#
(self) -> float
- class Disc(*args, **kwargs)#
Bases:
PrimitiveAnnular disc surface segment.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- property end_angle#
(self) -> float
- from_2d_to_3d#
- from_3d_to_2d#
- property inner_radius#
(self) -> float
- is_valid#
- property outer_radius#
(self) -> float
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property start_angle#
(self) -> float
- class Cone(*args, **kwargs)#
Bases:
PrimitiveConical surface segment with two radii.
- __init__#
- create_mesh#
Create a triangular mesh of this primitive.
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- property end_angle#
(self) -> float
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property radius1#
(self) -> float
- property radius2#
(self) -> float
- property start_angle#
(self) -> float
- class Sphere(*args, **kwargs)#
Bases:
PrimitiveSpherical surface segment with truncation.
- __init__#
- property apex_truncation#
(self) -> float
- property base_truncation#
(self) -> float
- create_mesh#
Create a triangular mesh of this primitive.
- create_mesh2#
Create a triangular mesh (alternative algorithm).
- distance#
- distance_jacobian_cutted_surface#
- distance_jacobian_cutting_surface#
- property end_angle#
(self) -> float
- from_2d_to_3d#
- from_3d_to_2d#
- is_valid#
- property p1#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p2#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property p3#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
- property radius#
(self) -> float
- property start_angle#
(self) -> float
Meshes#
- class ThermalMesh(*args, **kwargs)#
Bases:
objectThermal properties for a geometry item.
- __init__#
- property dir1_mesh#
(self) -> list[float]
- property dir2_mesh#
(self) -> list[float]
- is_valid#
- property side1_activity#
(self) -> bool
- property side1_color#
(self) -> pycanha::gmm::Color
- property side1_material#
(self) -> pycanha::gmm::BulkMaterial
- property side1_optical#
(self) -> pycanha::gmm::OpticalMaterial
- property side1_thick#
(self) -> float
- property side2_activity#
(self) -> bool
- property side2_color#
(self) -> pycanha::gmm::Color
- property side2_material#
(self) -> pycanha::gmm::BulkMaterial
- property side2_optical#
(self) -> pycanha::gmm::OpticalMaterial
- property side2_thick#
(self) -> float
- class TriMesh(*args, **kwargs)#
Bases:
objectTriangulated surface mesh.
- __init__#
- property edges#
(self) -> list[numpy.ndarray[dtype=uint32, shape=(*), order=’C’]]
- property face_ids#
(self) -> numpy.ndarray[dtype=uint32, shape=(*), order=’C’]
- property faces_edges#
(self) -> list[numpy.ndarray[dtype=uint32, shape=(*), order=’C’]]
- get_edges#
- get_face_cumareas#
- get_face_ids#
- get_faces_edges#
- get_perimeter_edges#
- get_triangles#
- get_vertices#
- property perimeter_edges#
(self) -> numpy.ndarray[dtype=uint32, shape=(*), order=’C’]
- set_edges#
- set_face_ids#
- set_faces_edges#
- set_perimeter_edges#
- property surface1_color#
(self) -> std::array<unsigned char, 3ul>
- property surface2_color#
(self) -> std::array<unsigned char, 3ul>
- class TriMeshModel(*args, **kwargs)#
Bases:
objectUnified triangle mesh for the full model.
- __init__#
- add_mesh#
- property back_colors#
(self) -> list[std::array<unsigned char, 3ul>]
- clear#
- property edges#
(self) -> list[numpy.ndarray[dtype=uint32, shape=(*), order=’C’]]
- property face_activity#
(self) -> list[int]
- property face_ids#
(self) -> numpy.ndarray[dtype=uint32, shape=(*), order=’C’]
- property faces_edges#
(self) -> list[numpy.ndarray[dtype=uint32, shape=(*), order=’C’]]
- property front_colors#
(self) -> list[std::array<unsigned char, 3ul>]
- property geometries_edges#
(self) -> list[int]
- property geometries_id#
(self) -> list[int]
- property geometries_perimeter_edges#
(self) -> list[int]
- property geometries_triangles#
(self) -> list[int]
- property geometries_vertices#
(self) -> list[int]
- get_face_cumareas#
- get_geometry_mesh#
- property n_faces#
(self) -> int
- property n_geometries#
(self) -> int
- property opticals#
(self) -> list[std::array<float, 6ul>]
- property perimeter_edges#
(self) -> numpy.ndarray[dtype=uint32, shape=(*), order=’C’]
Transformations#
- class CoordinateTransformation(*args, **kwargs)#
Bases:
objectTranslation + rotation coordinate transformation.
- __init__#
- property order#
(self) -> pycanha_core.pycanha_core.gmm.TransformOrder
- property rotation#
(self) -> numpy.ndarray[dtype=float64, shape=(3, 3), order=’F’]
- transform_point#
Apply the transformation to a 3D point.
- property translation#
(self) -> numpy.ndarray[dtype=float64, shape=(3), order=’C’]
Geometry hierarchy#
- class Geometry(*args, **kwargs)#
Bases:
objectBase class for geometry elements.
- __init__#
- property name#
(self) -> str
- property parent#
(self) -> std::weak_ptr<pycanha::gmm::GeometryGroup>
- property transformation#
(self) -> pycanha_core.pycanha_core.gmm.CoordinateTransformation
- class GeometryItem(*args, **kwargs)#
Bases:
GeometryGeometry item.
- __init__#
- property primitive#
(self) -> pycanha_core.pycanha_core.gmm.Primitive
- class GeometryMeshedItem(*args, **kwargs)#
Bases:
GeometryItemGeometry item with an associated thermal mesh.
- __init__#
- property thermal_mesh#
(self) -> pycanha_core.pycanha_core.gmm.ThermalMesh
- property tri_mesh#
(self) -> pycanha::gmm::TriMesh
- triangulate_post_processed_cutted_mesh#
- class GeometryGroup(*args, **kwargs)#
Bases:
GeometryCollection of geometry items and sub-groups.
- __init__#
- add_geometry_group#
- add_geometry_item#
- property geometry_groups#
(self) -> list[pycanha_core.pycanha_core.gmm.GeometryGroup]
- property geometry_groups_cutted#
(self) -> list[pycanha::gmm::GeometryGroupCutted]
- property geometry_items#
(self) -> list[pycanha_core.pycanha_core.gmm.GeometryMeshedItem]
- remove_geometry_group#
- remove_geometry_item#
- class GeometryGroupCutted#
Bases:
GeometryGroupGeometry group with cutting items applied.
- __init__(*args, **kwargs)#
- add_cutting_geometry_item#
- create_cutted_mesh#
- property cutted_geometry_meshed_items#
(self) -> list[pycanha_core.pycanha_core.gmm.GeometryMeshedItem]
- property cutting_geometry_items#
(self) -> list[pycanha_core.pycanha_core.gmm.GeometryItem]
- remove_cutting_geometry_item#
- class GeometryModel(*args, **kwargs)#
Bases:
objectTop-level container for the geometry model.
- __init__#
- callback_primitive_changed#
- copy_mesh#
Copy meshes into the unified TriMeshModel.
- create_geometry_group#
- create_geometry_group_cutted#
- create_geometry_item#
- create_mesh#
Mesh all geometry items.
- get_root_geometry_group#
- get_trimesh_model#
Mesh utility functions#
- cdt_trimesher(trimesh: pycanha_core.pycanha_core.gmm.TriMesh) None#
Refine a TriMesh using constrained Delaunay triangulation.
- 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.
- 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.
- 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.
- 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.
- create_2d_disc_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: float, arg5: float, /) pycanha_core.pycanha_core.gmm.TriMesh#
Generate a 2D disc mesh.