Import std.math.polygon
Triangulate
function
@PanicsAtCaller Public Function Triangulate(outer: Vec2[]): (Int, Int, Int)[]
The triangles that fill the ring, each as indices of its corners, counterclockwise.
function
@PanicsAtCaller Public Function Triangulate(outer: Vec2[], holes: Vec2[][]): (Int, Int, Int)[]
The triangles that fill the outer ring less its holes, each as indices of its corners in the
rings one after another, the outer ring's first, counterclockwise: Mapbox's earcut, without
its z-order hash, which cuts off one convex corner with no other corner in its triangle at a
time, once each hole is joined to the outer ring by a bridge from its leftmost corner to a
corner it sees. A ring's last corner may repeat its first. An outer ring of fewer than three
corners gives none, and a hole of fewer than three is left out. A corner that isn't finite
panics.
Report an issue with this page or with FutureBlitz on GitHub.