mymesh.utils.BaryTri#
- mymesh.utils.BaryTri(Nodes, Pt, d=None)[source]#
Returns the bary centric coordinates of a point (Pt) relative to a triangle (Nodes)
- Parameters:
Nodes (np.ndarray) – List of coordinates of the triangle vertices.
Pt (np.ndarray) – Coordinates of the point.
d (int, NoneType) – Number of dimensions (2 or 3). For points and triangles in a plane, barycentric coordinates can be calculated more efficiency. In performance-critical applications, always specify either 2 or 3.
- Returns:
alpha (float) – First barycentric coordinate.
beta (float) – Second barycentric coordinate.
gamma (float) – Third barycentric coordinate.