UNPKG

@allmaps/triangulate

Version:

Allmaps Triangulation Library

13 lines (12 loc) 1.25 kB
import type { Bbox, Line, Ring, Polygon, Point } from '@allmaps/types'; import type { KDBushPointIndex, PolygonForInsidenessCheck } from './types.js'; export declare function pointOnLine(point: Point, line: Line, exclude?: boolean): boolean; export declare function buildKDBushPointIndex(points: [number, number][]): KDBushPointIndex; export declare function splitRingLines(ring: [number, number][], { tree, points }: KDBushPointIndex): [number, number][]; export declare function splitPolygonLines(polygon: [number, number][][], points: [number, number][], index?: KDBushPointIndex): [number, number][][]; export declare function interpolateRing(ring: Ring, dist: number): Ring; export declare function interpolatePolygon(polygon: Polygon, dist: number): Polygon; export declare function bboxToGridPoints(bbox: Bbox, gridSize: number): Point[]; export declare function preprocessPolygonForInsideCheck(polygon: Point[][]): PolygonForInsidenessCheck; export declare function coordsInPolygonForInsidenessCheck(x: number, y: number, polygonForInsidenessCheck: PolygonForInsidenessCheck): boolean | 0; export declare function coordsInPolygonsForInsidenessCheck(x: number, y: number, polygonsForInsidenessChecks: PolygonForInsidenessCheck[]): boolean;