A flat array of vertex coordinates like [x0,y0, x1,y1, x2,y2, ...].
Optional
holeIndices: number[](Optional) An array of hole indices if any, (e.g. [5, 8] or a 12-vertex input would mean one hole with vertices 5–7 and another with 8–11).
Optional
dim: numberThe number of coordinates per vertex in the input array. Default is 2.
Triangulates the given shape definition by returning an array of triangles. A triangle is defined by three consecutive integers representing vertex indices.
Example
Returns
A flat array of triangles where each group of three vertices indices forms a triangle.