Appearance
KBE3D / KBCore / turf / tesselate
函数: tesselate()
tesselate(
poly:Feature<Polygon|MultiPolygon>):FeatureCollection<Polygon>
Function
Tesselates a polygon or multipolygon into a collection of triangle polygons using earcut.
参数
poly
Feature<Polygon | MultiPolygon>
the polygon to tesselate
返回
collection of polygon tesselations
示例
ts
const poly = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
const triangles = turf.tesselate(poly);
//addToMap
const addToMap = [poly, triangles]