import { NodeIO } from '@gltf-transform/core'; /** A 1 km cell at meshopt's default 14 bits keeps 6 cm, which is half a kerb; two more bits buy 1.6 cm. */ export declare const CS2_QUANTIZE_POSITION_BITS = 16; export interface Cs2GlbMaterial { name: string; /** Linear RGBA, the space glTF stores factors in. */ baseColorFactor: [number, number, number, number]; roughnessFactor: number; doubleSided: boolean; /** Bare file name of a KTX2 sitting beside the GLB; it is also the image name the externalizer joins on. */ baseColorFile?: string; /** Set to switch the material to `MASK`. */ alphaCutoff?: number; } export interface Cs2GlbPrimitive { /** Omitted for the collider tier, which carries no materials at all. */ material?: string; positions: Float32Array; indices: Uint32Array; normals?: Float32Array; uvs?: Float32Array; /** Linear RGB per vertex, written as `COLOR_0`. */ colours?: Float32Array; } export interface Cs2WeldedSimplification { positions: Float32Array; indices: Uint32Array; trianglesBefore: number; trianglesAfter: number; /** Absolute, in metres: the simplifier runs with `ErrorAbsolute`. */ errorMetres: number; } /** glTF factors and `COLOR_0` are linear; every colour this converter quotes is an sRGB hex, so decode it once here. */ export declare function linearFromSrgbHex(hex: string): [number, number, number]; /** Area polygons and marking ribbons ship no source normals, and a glTF primitive without `NORMAL` shades wrong. */ export declare function computeVertexNormals(positions: Float32Array, indices: Uint32Array): Float32Array; /** Reads and writes the GLBs this converter emits: KTX2 images, quantized positions, meshopt payloads. */ export declare function cs2GltfIo(): NodeIO; /** * One mesh, one primitive per material, world-space positions. Every KTX2 image is left out of the container and * referenced by bare file name, so the whole city shares one texture set instead of one copy per cell. */ export declare function writeCs2Glb(name: string, materials: readonly Cs2GlbMaterial[], primitives: readonly Cs2GlbPrimitive[]): Promise; /** * Welds by exact position, then simplifies to a triangle budget. A collider only has to be walkable, so it drops * every attribute but position and accepts the seams welding introduces. */ export declare function weldAndSimplify(positions: Float32Array, indices: Uint32Array, maxTriangles: number, errorMetres: number, /** Simplify within `errorMetres` even when the welded mesh already fits `maxTriangles` (default: a mesh under budget is returned welded, as drawn). */ reduceUnderBudget?: boolean): Promise; /** * Simplifies an already welded mesh to a triangle budget within `errorMetres`, never moving a vertex `lock` marks: the triangles whose * corners are all locked come through as they went in, and the rest collapse around them. */ export declare function simplifyLocked(positions: Float32Array, indices: Uint32Array, lock: Uint8Array, maxTriangles: number, errorMetres: number): Promise;