Class TriangulatorPolygons

Source
Expand description

Class for triangulating polygons from GeoJSON features. It provides methods to convert different geometry types into polygon meshes.

Constructors§

§

new TriangulatorPolygons(): TriangulatorPolygons

Methods§

Source§

buildBorder(
    geojson: FeatureCollection,
    origin: number[],
): [ILayerBorder[], ILayerBorderComponent[]]

Converts GeoJSON features into a collection of borders.

Source§

buildMesh(
    geojson: FeatureCollection,
    origin: number[],
): [ILayerGeometry[], ILayerComponent[]]

Builds a mesh from GeoJSON features representing polygons.

Source§

generateBorderIds(nCoords: number): number[]

Generates border indices for a given number of coordinates.

Source§

lineStringToBorderMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a LineString feature to a border representation.

Source§

lineStringToMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a LineString feature to a border representation.

Source§

multiLineStringToBorderMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a MultiLineString feature to a border representation.

Source§

multiLineStringToMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a MultiLineString feature to a mesh representation.

Source§

multiPolygonToBorderMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a MultiPolygon feature to a border representation.

Source§

multiPolygonToMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a MultiPolygon feature to a mesh representation.

Source§

polygonToBorderMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a Polygon feature to a border representation.

Source§

polygonToMesh(
    feature: Feature,
    origin: number[],
): { flatCoords: number[]; flatIds: number[] }[]

Converts a Polygon feature to a mesh representation.