# tesselate

Tesselates a Feature into a FeatureCollection of triangles using earcut.
使用 earcut (opens new window) 算法将Feature细分为FeatureCollection三角形。

参数

参数 类型 描述
poly Feature <Polygon> the polygon to tesselate

返回

FeatureCollection <Polygon> - a geometrycollection feature

示例

var poly = turf.polygon([[
  [11, 0], // 注意:polygon首尾坐标要一致 
  [22, 4], 
  [31, 0], 
  [31, 11], 
  [21, 15], 
  [11, 11], 
  [11, 0]]
]);
var triangles = turf.tesselate(poly);
Last Updated: 1/17/2023, 5:38:58 PM