perthcpe23 / earcut-j

Java port of mapbox/earcut (javascript)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

earcut-j

Java port of https://github.com/mapbox/earcut

Usage

Add jar to classpath then

Earcut e = new Earcut();

// coordinates are in order x1, y1, x2, y2, x3, y3,...
int[] indices = e.triangulate(new double[] {10, 0, 0, 50, 60, 60, 70, 10}, new int[] {}, 2);
// result = [1, 0, 3, 3, 2, 1]
// which are indices of two triangles

About

Java port of mapbox/earcut (javascript)

License:ISC License


Languages

Language:Java 100.0%