Download Now

    Reference Triangulate

    Declared in Codebot.Geometry.pas on lines 488, 489

    Triangulate cuts a simple polygon, which may be concave, into triangles by clipping ears. The points are the corners of the polygon in order, wound either way, and the last is joined to the first. The result holds three points for each triangle, wound the same way as the polygon. Points which repeat the point before are dropped. A polygon whose edges cross is still cut into triangles, though they may overlap.
    function Triangulate(Points: PVec2; Count: Integer): TVec2Array; overload;
    function Triangulate(const Points: TVec2Array): TVec2Array; overload;