https://github.com/comradevanti/unityearclip
Super lightweight ear-clipping 2D polygon triangulation package for Unity
https://github.com/comradevanti/unityearclip
2d ear-clipping geometry mesh package polygon triangulation unity unity2d unity3d
Last synced: 8 months ago
JSON representation
Super lightweight ear-clipping 2D polygon triangulation package for Unity
- Host: GitHub
- URL: https://github.com/comradevanti/unityearclip
- Owner: ComradeVanti
- License: unlicense
- Created: 2023-05-09T13:14:54.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T10:31:10.000Z (over 1 year ago)
- Last Synced: 2025-02-21T08:34:20.001Z (8 months ago)
- Topics: 2d, ear-clipping, geometry, mesh, package, polygon, triangulation, unity, unity2d, unity3d
- Language: C#
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Ear-clip
[](https://openupm.com/packages/dev.comradevanti.ear-clip/)
Super lightweight ear-clipping 2D polygon triangulation package for Unity.
Can only handle [simple](https://en.wikipedia.org/wiki/Simple_polygon) polygons.[Changelog](./CHANGELOG.md)
**⚠️ 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
```csharp
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();
```
## InstallationInstall via OpenUPM `openupm add dev.comradevanti.ear-clip`
## Compatibility
Developed with for Unity 2021.3.