Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 996 Bytes

README.md

File metadata and controls

35 lines (23 loc) · 996 Bytes

Ear-clip

openupm

Super lightweight ear-clipping 2D polygon triangulation package for Unity. Can only handle simple polygons.

Changelog

⚠️ Development is paused ⚠️
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.

Usage

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();

Installation

Install via OpenUPM openupm add dev.comradevanti.ear-clip

Compatibility

Developed with for Unity 2021.3.