MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / get_triangle_orientations_raw

Function get_triangle_orientations_raw

python/pymesh/meshutils/face_utils.py:42–57  ·  view source on GitHub ↗

Compute orientation of each triangle. A triangle is considered as positively oriented iff its three corners are counterclockwise ordered. Args: vertice (``numpy.ndarray``): n by 3 matrix representing vertices. faces (``numpy.ndarray``): m by 3 matrix of vertex indices repr

(vertices, faces)

Source from the content-addressed store, hash-verified

40 return get_degenerated_faces_raw(mesh.vertices, mesh.faces)
41
42def get_triangle_orientations_raw(vertices, faces):
43 """ Compute orientation of each triangle. A triangle is considered as
44 positively oriented iff its three corners are counterclockwise ordered.
45
46 Args:
47 vertice (``numpy.ndarray``): n by 3 matrix representing vertices.
48 faces (``numpy.ndarray``): m by 3 matrix of vertex indices representing
49 triangles.
50
51 Returns:
52 A list of m floats, where
53 * Positive number => triangle is positively oriented.
54 * 0 => triangle is degenerate.
55 * Negative number => triangle is negatively oriented.
56 """
57 return PyMesh.get_triangle_orientations(vertices, faces)
58
59def get_triangle_orientations(mesh):
60 """ A thin wrapper of ``get_triangle_orientations_raw``.

Callers 1

Calls 1

Tested by

no test coverage detected