export interface MeshBuildingRow { id: string; prefab: string; position: [number, number, number]; yawDeg: number; scale: number; heightM: number; } export interface BuildingPartsOptions { /** `helix.city-source/1` folder with `buildings.ndjson.gz`. */ citySource: string; /** The data root: `buildings/prototypes.json` inside, part documents written beside it. */ data: string; sceneId?: string; title?: string; /** At most this many buildings per part document (default 3,800 of the 4,096-node cap). */ maxNodesPerPart?: number; /** A near stream group is cut until its declared memory is at most this (default 48 MiB; the desktop gate refuses 64, the mobile gate 24); more parts are added, never a larger group, to fit the group count. */ groupCapMiB?: number; /** A near group's cell is at most this many metres on a side (default 700; the perf gate refuses 1,024). */ groupSideM?: number; /** A near group holds at most this many near triangles (default 150,000; the perf gate refuses 300,000). */ groupTriangles?: number; /** * A near group draws at most this many calls (one per glTF primitive of each node; default unlimited). The phone gate (P06) refuses a * camera cell whose resident groups plus the HLOD clusters draw more than 150: a camera on the seam of four groups has all four resident. */ groupDraws?: number; /** At most this many parts (default 8, the engine's resident-mount limit). */ maxParts?: number; /** * Cut the parts so each holds about the same number of stream groups instead of the same number of buildings. A dense downtown cuts into several times * as many groups as the same number of buildings on the edge of town, and a Scene document holds 512 at most, so by count the densest part decides how * many parts a map needs; every part a phone mounts promises at least 32 MiB, so fewer parts is memory. */ balanceGroups?: boolean; /** HLOD: the coarse cell size and layer reach. */ hlodCellM?: number; /** HLOD layer: maximum simplification error of the coarse level, metres (default 2). */ hlodMaxErrorM?: number; /** HLOD bake settings the documents declare (`scene hlod bake-complete` reads them): shared appearance density and tile range. Defaults 1 texel/m, 64..256 px. */ hlodBake?: { texelsPerM?: number; minTileSize?: number; maxTileSize?: number; }; log?: (line: string) => void; } export interface BuildingPartsReport { parts: Array<{ file: string; id: string; nodes: number; resources: number; groups: number; groupCapMiB: number; largestGroupMiB: number; nearDeclaredMiB: number; bytes: number; }>; buildings: { total: number; withMesh: number; placed: number; markers: number; noPrototype: number; byReason: Record; }; } /** Quaternion of a rotation about +Y (three.js `rotation.y`), the convention `mesh.transform.yawDeg` is written in. */ export declare function yawQuaternion(yawDeg: number): [number, number, number, number]; export declare function readMeshBuildings(citySource: string): { rows: MeshBuildingRow[]; total: number; markers: number; }; /** What a prototype costs while resident, in the engine's accounting: geometry and compressed texture mips counted twice (CPU + GPU copy). */ export declare function prototypeResidentBytes(glbBytes: number, textures: Array<[number, number]>): number; export declare function buildBuildingParts(options: BuildingPartsOptions): BuildingPartsReport;