/** Simplifier tolerance, metres: a lane is 3 m wide and 6 px at 900 m, so a third of a metre is under a pixel. */ export declare const FAR_ERROR_M = 0.3; /** The far surface sits this far under the near one, metres. */ export declare const FAR_DROP_M = 0.03; /** Far cells are two near cells wide, so they stay aligned with them. */ export declare const FAR_CELL_FACTOR = 2; /** The far layer's 16-bit lattice: 2,184 m of range, enough for a 2,048 m cell, 3.3 cm steps. */ export declare const FAR_LATTICE_PER_M = 30; /** The surface kinds that are a road to drive on. Sidewalks, kerbs and concrete (structure, undersides) are near detail. */ export declare const FAR_SURFACES: readonly number[]; /** One restyled near cell, as the restyle builds it. `origin` is the cell corner on x and z. */ export interface FarSourceCell { cx: number; cz: number; origin: readonly [number, number]; positions: Float32Array; kinds: Uint8Array; indices: Uint32Array; } export interface FarCellResult { cx: number; cz: number; file: string; bytes: Uint8Array; triangles: number; trianglesBefore: number; bounds: { min: [number, number, number]; max: [number, number, number]; }; } export interface FarLayerResult { cellSizeM: number; originX: number; originZ: number; cells: FarCellResult[]; /** Largest simplification error reported by the simplifier over every cell and surface, metres. */ maxErrorM: number; /** Largest drop a kept vertex took to stay under the near surface (`farVertexDrops`), metres; `dropM` where nothing rose. */ maxDropM: number; } /** Builds the far layer from the restyled near cells; the caller writes each result's file. */ export declare function buildFarLayer(cells: readonly FarSourceCell[], nearSizeM: number, nearOriginX: number, nearOriginZ: number, options?: { errorM?: number; dropM?: number; surfaces?: readonly number[]; }): Promise; /** Spacing of the clamp's samples along a source edge, metres. */ export declare const FAR_CLAMP_SAMPLE_M = 0.5; /** * How far each kept far vertex must drop so the far surface lies `dropM` under the near one EVERYWHERE, not just on average. The simplifier * keeps a vertex where it was and moves the faces between them by up to its error, both ways: where it points upward the eager far layer * covered the near asphalt, its paint and the car on it (measured on Pacifica's highways: 4.3 % of the far surface over 0.3 m above the near * one, a car that read as sunk 0.3-0.4 m into a road with no markings). Every source vertex is looked up in the simplified triangle over it; * the triangle's three corners drop by the most it rose over any of them, plus `dropM`. Source vertices alone are not enough: where a long * source face (a 40-75 m asphalt sliver along a rail bridge) is crossed by far edges, the far surface can rise over the middle of it while * sitting under both of its ends (Pacifica s14: 3.9 % of the far layer over 5 cm above the near road, up to 3 m on the rail-bridge band). * So every source edge is also sampled every FAR_CLAMP_SAMPLE_M; the gap between two piecewise-planar surfaces peaks on a source edge or * at a vertex, and the samples bound what they miss to the slope difference over half a step. */ export declare function farVertexDrops(welded: Float32Array, source: readonly number[], simplified: Uint32Array, dropM: number): { byVertex: Map; max: number; };