import type { CitySource } from '../source'; import { type RoadGeneratorOptions } from './constants'; import { type ElevationStats, type GroundHeight } from './elevation'; export interface RoadCellStats { vertices: number; trianglesRender: number; trianglesByPrimitive: number[]; glbBytes: number; colliderTriangles: number; colliderTrianglesBeforeSimplify: number; colliderErrorM: number; colliderBytes: number; edges: number; junctions: number; } export interface RoadCell { cx: number; cz: number; glb: Uint8Array; glbSha256: string; collider: Uint8Array | null; colliderSha256: string | null; /** The lane paint as a GLB of its own, drawn with the cell (CS2 baked roads keep the game's paint ribbons apart from the surface). */ paint?: { glb: Uint8Array; glbSha256: string; }; stats: RoadCellStats; } /** World-space road surface handed to the terrain conform. */ export interface RoadSurfaceSet { /** The 1,024 m cell these triangles came from. */ cx: number; cz: number; /** Baked roads only: x, y, z of the centre of every down-facing triangle (a deck's underside, a tunnel's roof) in this cell, for the terrain carve to tell a tunnel from an open cut. */ roofs?: Float32Array; /** `kinds`: the vertices' `_ROAD.x` surface kinds (asphalt, concrete, sett, gravel for the driving surface). */ asphalt: { positions: Float32Array; indices: Uint32Array; kinds: Uint8Array; }; pavement: { positions: Float32Array; indices: Uint32Array; kinds: Uint8Array; }; } export interface RoadBuildReport { sourceEdges: number; renderedEdges: number; mergedChains: number; skipped: Record; junctions: number; roundaboutIslands: number; roundaboutsSkipped: number; /** Tunnel mouths drawn: a headwall and a box over the road where a drawn road meets a tunnel that is not. */ tunnelPortals: number; /** Freeway diverges and merges built as a gore with an aux lane, instead of by the junction solver. */ goreJunctions: number; /** Node ids of those gores, in network order. */ goreNodes: string[]; degenerateJunctions: string[]; /** Hull fallbacks that touch a motorway or trunk edge: the freeway nodes the solver could not build properly. */ freewayHullFallbacks: number; dualCarriageways: number; elevation: ElevationStats; /** Bridge piers (a column or two under a bent cap) emitted under deck edges, counted per cell they fall in. */ bridgePiers: number; cells: number; } export interface RoadBuildResult { cells: RoadCell[]; report: RoadBuildReport; /** Per-cell surfaces for the terrain conform; only when `collectSurfaces` was set. */ surfaces: RoadSurfaceSet[]; } export interface RoadBuildInput { source: CitySource; ground: GroundHeight; options?: RoadGeneratorOptions; collectSurfaces?: boolean; /** Apply overrides.json first (default true). */ applyOverrides?: boolean; } export declare function generateRoads(input: RoadBuildInput): Promise; export interface RoadsManifestCell { cx: number; cz: number; glb: string; glbSha256: string; collider: string | null; colliderSha256: string | null; stats: RoadCellStats; } /** Writes `chunks/road/.glb`, `chunks/road-collider/.glb` and `roads-manifest.json` (no wall-clock, so it is reproducible). */ export declare function writeRoadCells(outDir: string, result: RoadBuildResult, sourceId: string, sourceManifestSha256: string | null, extra?: Record): Promise<{ manifestPath: string; manifest: Record; }>;