import { type CityArea } from '../../source'; import type { Frame } from './frame'; import { type PolygonWithHoles } from './poly'; import type { RefusalLog } from './refusals'; export interface AreaStats { records: number; rows: number; kinds: Record; withHoles: number; totalKm2: number; } /** Split a closed vertex loop wherever a vertex repeats, so each piece visits every vertex at most once. */ export declare function splitAtPinches(loop: number[]): number[][]; /** Directed boundary loops of a triangle set, in scene (x, z). Triangles are re-wound CCW from above first. */ export declare function trianglesToPolygons(positions: ArrayLike, vertexIds: Uint32Array | number[], weld?: number): { polygons: PolygonWithHoles[]; orphanHoles: number; }; /** * The outline of a triangle set by rasterising it, for records whose triangles overlap or double back so that the exact * boundary is not a simple polygon. The outline is within one cell (0.25 m, coarser only for areas over 400 m across). */ export declare function rasterPolygons(positions: ArrayLike, vertexIds: Uint32Array | number[]): { polygons: PolygonWithHoles[]; orphanHoles: number; }; export declare function importAreas(bundle: string, frame: Frame, refusals: RefusalLog): Promise<{ areas: CityArea[]; stats: AreaStats; }>; export interface CleanedPolygon extends PolygonWithHoles { /** What was done to make the polygon simple, when it was not simple as traced. */ repairs: Array<'hole-shrunk' | 'hole-dropped'>; } /** * Simplify and round a polygon; null when what is left is not a clean simple polygon. A hole that touches its own * outer ring (a park with a pond cut to its edge) cannot be a valid hole, so it is shrunk until it clears, or dropped. */ export declare function cleanPolygon(polygon: PolygonWithHoles): CleanedPolygon | null; export declare const AREA_STRIDES: { record: number; position: number; };