pycanha.gmm — Geometric Mathematical Model#
Geometric primitives for defining thermal surface elements.
Primitives#
- class pycanha.gmm.Triangle(p1, p2, p3)[source]#
Bases:
TriangleTriangular flat surface defined by three 3D vertices.
- Parameters:
p1 (npt.ArrayLike)
p2 (npt.ArrayLike)
p3 (npt.ArrayLike)
- normal_at_uv(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Outward surface normal at a 2D parametric (uv) point.
- property p1#
First vertex.
- property p2#
Second vertex.
- property p3#
Third vertex.
- to_cartesian(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Map a 2D parametric (uv) point back to 3D space.
- to_uv(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
Project a 3D point onto the primitive’s 2D parametric (uv) space.
- class pycanha.gmm.Rectangle(p1, p2, p3)[source]#
Bases:
RectangleRectangular flat surface: p1->p2 is one edge, p1->p3 the adjacent edge.
- Parameters:
p1 (npt.ArrayLike)
p2 (npt.ArrayLike)
p3 (npt.ArrayLike)
- normal_at_uv(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Outward surface normal at a 2D parametric (uv) point.
- property p1#
Origin vertex.
- property p2#
Second vertex (first edge from p1).
- property p3#
Third vertex (second edge from p1).
- to_cartesian(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Map a 2D parametric (uv) point back to 3D space.
- to_uv(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
Project a 3D point onto the primitive’s 2D parametric (uv) space.
- class pycanha.gmm.Quadrilateral(p1, p2, p3, p4)[source]#
Bases:
QuadrilateralGeneral quadrilateral surface defined by four vertices.
- Parameters:
p1 (npt.ArrayLike)
p2 (npt.ArrayLike)
p3 (npt.ArrayLike)
p4 (npt.ArrayLike)
- normal_at_uv(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Outward surface normal at a 2D parametric (uv) point.
- property p1#
First vertex.
- property p2#
Second vertex.
- property p3#
Third vertex.
- property p4#
Fourth vertex.
- to_cartesian(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Map a 2D parametric (uv) point back to 3D space.
- to_uv(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
Project a 3D point onto the primitive’s 2D parametric (uv) space.
- class pycanha.gmm.Cylinder(p1, p2, p3, radius, start_angle, end_angle)[source]#
Bases:
CylinderCylindrical surface segment defined by axis, radius and angular extent.
- Parameters:
- property end_angle#
End angle [rad].
- normal_at_uv(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Outward surface normal at a 2D parametric (uv) point.
- property p1#
Base center position.
- property p2#
Top center position.
- property p3#
Reference point for the angle origin.
- property radius#
Cylinder radius.
- property start_angle#
Start angle [rad].
- to_cartesian(self, uv: numpy.ndarray[dtype=float64, shape=(2), order='C']) numpy.ndarray[dtype=float64, shape=(3), order='C']#
Map a 2D parametric (uv) point back to 3D space.
- to_uv(self, point: numpy.ndarray[dtype=float64, shape=(3), order='C']) numpy.ndarray[dtype=float64, shape=(2), order='C']#
Project a 3D point onto the primitive’s 2D parametric (uv) space.