Skip to main content
Version: 7.1.0

tesselate

Description

Tesselates a polygon or multipolygon into a collection of triangle polygons using earcut.

Parameters

NameTypeDescription
polyFeature<Polygon | MultiPolygon>the polygon to tesselate

Returns

Examples

const poly = turf.polygon([
[
[11, 0],
[22, 4],
[31, 0],
[31, 11],
[21, 15],
[11, 11],
[11, 0],
],
]);
const triangles = turf.tesselate(poly);

Installation

$ npm install @turf/tesselate

import { tesselate } from "@turf/tesselate";
const result = tesselate(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.tesselate(...);