love.math.triangulate

Available since LÖVE 0.9.0
This function is not supported in earlier versions.

Triangulate a simple polygon.

Function

Synopsis

triangles = love.math.triangulate( polygon )

Arguments

table polygon
Polygon to triangulate. Must not intersect itself.

Returns

table triangles
List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.

See Also

Other Languages