A TriangleMesh has its interior defined by the direction of its normals, which should be outward-facing. If a mesh has inward-facing normals, this changes the definition of the interior of the mesh, which may not be desired, and may not be reflected in frontend plotting.
This PR warns the user if this mesh error is detected (such a mesh will have negative volume). It also adds a function that can be easily used to repair the mesh. There may be cases where such a mesh is desired, but this will be rare compared to the case where the mesh accidentally had inward-facing normals.
A
TriangleMesh
has its interior defined by the direction of its normals, which should be outward-facing. If a mesh has inward-facing normals, this changes the definition of the interior of the mesh, which may not be desired, and may not be reflected in frontend plotting.This PR warns the user if this mesh error is detected (such a mesh will have negative volume). It also adds a function that can be easily used to repair the mesh. There may be cases where such a mesh is desired, but this will be rare compared to the case where the mesh accidentally had inward-facing normals.