mesh.Mesh.fix_normals#

Mesh.fix_normals()#

Reorient face normals of a triangular surface mesh (tri3) so that they are consistently oriented.

The operation analyzes triangle winding and flips faces where necessary to achieve a uniform orientation over the surface. For closed, manifold meshes this typically results in outward- pointing normals.

Returns#

Mesh

A new triangle mesh with consistent face winding and outward normals.

Notes#

  • Only implemented for eltype='tri3'.

  • For broader repair (duplicate removal, degenerate triangles, hole filling, etc.), see fix_triangle_mesh().

Examples#

>>> mesh = shapes.cuboid().reverse()
>>> print(mesh.enclosed_volume())
-1.0
>>> fixed = mesh.fix_normals()
>>> print(fixed.enclosed_volume())
1.0