@allmaps/triangulate
Version:
Allmaps Triangulation Library
35 lines (34 loc) • 1.16 kB
TypeScript
import type KDBush from 'kdbush';
import type { Bbox, Point, Polygon, Triangle, TypedLine, TypedPolygon, TypedTriangle } from '@allmaps/types';
export type TriangulationToUnique = {
interpolatedPolygon: Polygon;
interpolatedPolygonPoints: Point[];
gridPoints: Point[];
gridPointsInPolygon: Point[];
interpolatedSteinerPolygons: Polygon[];
interpolatedSteinerPolygonsPoints: Point[];
uniquePoints: Point[];
triangles: Triangle[];
uniquePointIndexTriangles: TypedTriangle<number>[];
uniquePointIndexInterpolatedPolygon: TypedPolygon<number>;
uniquePointIndexEdges: TypedLine<number>[];
uniquePointIndexInterpolatedSteinerPolygons: TypedPolygon<number>[];
insideSteinerPolygonsTriangles: boolean[];
};
export type TriangluationOptions = {
steinerPoints: Point[];
steinerPolygons: Polygon[];
minimumTriangleAngle: number;
computeInsideSteinerPolygons: boolean;
};
export type KDBushPointIndex = {
tree: KDBush;
points: [number, number][];
};
export type PolygonForInsidenessCheck = {
closedRings: {
coords: Float64Array;
length: number;
}[];
bbox: Bbox;
};