Earcut

An implementation of the earcut polygon triangulation algorithm. The code is a port of mapbox/earcut.

Methods

.triangulate ( data, holeIndices, dim ) : Array

data — A flat array of vertex coordinates.

holeIndices — An array of hole indices if any.

dim — The number of coordinates per vertex in the input array.

Triangulates the given shape definition by returning an array of triangles. A triangle is defined by three consecutive integers representing vertex indices.

Leave a comment

Your email address will not be published. Required fields are marked *