love.math.triangulate
Decomposes a simple convex or concave polygon into triangles.
triangles = love.math.triangulate( polygon )
polygon table Polygon to triangulate. Must not intersect itself.
triangles table List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.
triangles = love.math.triangulate( x1, y1, x2, y2, x3, y3 )
x1 number The position of the first vertex of the polygon on the x-axis.
y1 number The position of the first vertex of the polygon on the y-axis.
x2 number The position of the second vertex of the polygon on the x-axis.
y2 number The position of the second vertex of the polygon on the y-axis.
x3 number The position of the third vertex of the polygon on the x-axis.
y3 number The position of the third vertex of the polygon on the y-axis.
triangles table List of triangles the polygon is composed of, in the form of {{x1, y1, x2, y2, x3, y3}, {x1, y1, x2, y2, x3, y3}, ...}.