mymesh.utils.BaryTris#
- mymesh.utils.BaryTris(Tris, Pt)[source]#
Returns the barycentric coordinates of a point or points relative to a triangle. This can either compare a set of n triangles to a single point, or pairwise comparison between n triangles and n points.
- Parameters:
Tris (array_like) – nx3x3 coordinates of the vertices. The array should be formatted as if obtained by indexing NodeCoords[NodeConn] for a purely triangular mesh.
Pt (array_like) – Coordinates of the point or points. For a single point, this should have the a shape = (3,), for a set of points, this should have a shape = (n,3) where n is equal to the number of triangles.
- Returns:
alpha (float) – First barycentric coordinate.
beta (float) – Second barycentric coordinate.
gamma (float) – Third barycentric coordinate.