Skip to content

autk-map


autk-map / TriangulatorPoints

Class: TriangulatorPoints

Defined in: triangulator-points.ts:9

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

Constructors

Constructor

new TriangulatorPoints(): TriangulatorPoints

Returns

TriangulatorPoints

Methods

buildMesh()

static buildMesh(geojson, origin): [ILayerGeometry[], ILayerComponent[]]

Defined in: triangulator-points.ts:16

Builds a mesh from GeoJSON features representing points.

Parameters

geojson

FeatureCollection

The GeoJSON feature collection

origin

number[]

The origin point for translation

Returns

[ILayerGeometry[], ILayerComponent[]]

An array of geometries and components


multiPointToMesh()

static multiPointToMesh(feature, origin): object[]

Defined in: triangulator-points.ts:89

Converts a MultiPoint feature to a mesh representation.

Parameters

feature

Feature

The GeoJSON feature representing a MultiPoint

origin

number[]

The origin point for translation

Returns

object[]

An array containing the flat coordinates and indices


pointToMesh()

static pointToMesh(feature, origin): object[]

Defined in: triangulator-points.ts:63

Converts a Point feature to a mesh representation.

Parameters

feature

Feature

The GeoJSON feature representing a Point

origin

number[]

The origin point for translation

Returns

object[]

An array containing the flat coordinates and indices


sampleCircle()

static sampleCircle(centerX, centerY, radius, numPoints): [number, number][]

Defined in: triangulator-points.ts:122

Samples points on a circle.

Parameters

centerX

number

The x-coordinate of the circle's center

centerY

number

The y-coordinate of the circle's center

radius

number

The radius of the circle

numPoints

number

The number of points to sample on the circle

Returns

[number, number][]

An array of sampled points as [x, y] tuples

Released under the MIT License.