An implementation of the earcut polygon triangulation algorithm. The code is a port of mapbox/earcut.
Triangulates the given shape definition by returning an array of triangles. A triangle is defined by three consecutive integers representing vertex indices.
For more info on how to obtain the source code of this module see this page.