[name]

切割多边形三角剖分算法的实现。这份代码是[link:https://github.com/mapbox/earcut mapbox/earcut]的一个端口。

方法

[method:Array triangulate]( data, holeIndices, dim )

data -- 一个顶点坐标的平面数组。
holeIndices -- 空洞索引的数组(如果有的话)。
dim -- 输入数组中每个顶点的坐标数。

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

源代码

[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]