Expand description
Triangulating flat polygons, concave ones and ones with holes, by ear clipping: each hole is joined to the outer loop by a bridge to a vertex it can see, then ears (convex corners with no other vertex inside) are cut off one by one. A 3D polygon is first projected onto the axis plane it faces most. Used by the IFC reader for faceted faces.
Functions§
- newell
- The Newell normal of a 3D loop (not normalised).
- triangulate_
2d - Triangulates a flat polygon with holes. The result indexes the outer loop’s points followed by each hole’s in turn, and runs the same way round as the outer loop. Degenerate input gives fewer (or no) triangles, never a panic.
- triangulate_
3d - Triangulates a flat (or nearly flat) 3D polygon with holes, projected
onto the axis plane it faces most; indices as in
triangulate_2d, running the same way round as the outer loop.