Skip to content
FutureBlitz

    Install

    Import std.math.polygon

    Triangulate

    std.math.polygon

    function

    @PanicsAtCaller Public Function Triangulate(outer: Vec2[]): (Int, Int, Int)[]

    The triangles that fill the ring, each as indices of its corners, counterclockwise.

    std/math/polygon.fb, line 213

    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.

    std/math/polygon.fb, line 226

    Report an issue with this page or with FutureBlitz on GitHub.