Earcut - Verge3D User Manual - Soft8Soft
Description: Learn how to use Earcut in your interactive 3D apps made with Verge3D

# Earcut

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

## Methods

### # .triangulate(data : Array, holeIndices : Array, dim : Integer) → 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.

## Source

For more info on how to obtain the source code of this module see this page.