import type { GroundModel } from './ground'; export interface CorridorSurface { /** World x,y,z triples. */ positions: Float32Array; indices: Uint32Array; role: 'asphalt' | 'pavement'; } export interface ConformOptions { /** Grid spacing of the conformed raster. Default 2. */ metresPerSample?: number; /** Distance over which the cut or fill dies out to the natural ground. Default 3. */ blendMetres?: number; /** Terrain is held this far BELOW the surface. Default 0.12. */ clearanceM?: number; /** Samples farther than this from the surface (bridge decks high above ground) are left alone. Default 4. */ maxDeviationM?: number; /** A deeper cut or higher fill needs a longer bank: the blend reaches `|cut| x bankRatio` metres (never less than `blendMetres`). Default 1.5. */ bankRatio?: number; /** ... and never more than this, so a bank cannot reach the buildings across the street. Default 6. */ maxBankMetres?: number; } export interface ConformedTerrain { meta: { schema: 'helix.city-source-dem/1'; file: string; format: 'r16'; samples: [number, number]; metresPerSample: number; originXZ: [number, number]; heightRangeM: [number, number]; sha256: string; note?: string; }; /** Conformed height raster, same R16 convention as the source DEM, row 0 northernmost. */ r16: Uint8Array; /** One byte per sample, same layout: 0 = natural, 1 = asphalt, 2 = pavement (sidewalk/kerb), 3 = bank (a cut or fill slope beside a street, to be painted as ground cover, not bare earth); asphalt wins over pavement. */ splat: Uint8Array; splatMeta: { schema: 'helix.city-roads-splat/1'; file: string; samples: [number, number]; metresPerSample: number; originXZ: [number, number]; roles: { 0: 'natural'; 1: 'asphalt'; 2: 'pavement'; 3: 'bank'; }; sha256: string; }; stats: { samples: number; conformed: number; raised: number; lowered: number; blended: number; banks: number; maxCutM: number; maxFillM: number; }; } export declare const CONFORMED_DEM_FILE = "dem.conformed.r16"; export declare const CONFORMED_DEM_META_FILE = "dem.conformed.json"; export declare const SPLAT_ROLES_FILE = "splat-roles.u8"; export declare const SPLAT_ROLES_META_FILE = "splat-roles.json"; export declare const SPLAT_ROLES_SCHEMA: "helix.city-roads-splat/1"; /** * Cut and fill `ground` under the finished road surfaces, over a raster covering `boundsXZ`. * * Under every up-facing triangle (normal.y >= 0.7) the terrain is set `clearanceM` below the surface; the four corners * of every cell a triangle crosses are held below the triangle's lowest point over that cell (the cell is interpolated * from its corners, so the terrain cannot rise through a deck between samples). Overlapping triangles take the lowest * result. A surface farther than `maxDeviationM` from the ground at a sample (a bridge deck high above it) is ignored * there: no cut, no splat. Around the conformed samples the cut or fill dies out over `blendMetres` along a smoothstep. */ export declare function conformCityTerrain(ground: GroundModel, boundsXZ: [[number, number], [number, number]], surfaces: Iterable, options?: ConformOptions): ConformedTerrain; /** Writes `terrain/dem.conformed.{r16,json}` and `terrain/splat-roles.{u8,json}` under `dir`; returns their paths relative to it. */ export declare function writeConformedTerrain(dir: string, terrain: ConformedTerrain): Promise;