Super lightweight ear-clipping 2D polygon triangulation package for Unity. Can only handle simple polygons.
No new features will be added or bugs fixed unless requested through an issue.
If you wish to fork this repository and continue the work, you are very welcome
to do so.
using Dev.ComradeVanti.EarClip;
var points = new Vector2[] { ... };
// Points need to be in clockwise order
// Sort if needed
points = points.Clockwise().ToArray();
// Triangulate
var triangles = Triangulate.ConcaveNoHoles(points).ToArray();
Install via OpenUPM openupm add dev.comradevanti.ear-clip
Developed with for Unity 2021.3.