/** * Region 3D export (spec: issue #34 §"Technical Implementation Steps" — * region export; ported from a sibling project's proven implementation * rather than rebuilt from scratch, per direct instruction). Draw a 2D * footprint over loaded 3D Tiles content (BIM/`BIMLayer`, `Tile3DLayer`) * and export exactly the triangles inside it as a portable GLB — or a * b3dm-wrapped GLB for pipelines (Cesium, 3D Tiles tooling) that expect * that container. * * Deliberately simpler than the source implementation in one respect: tile * selection is a plain bbox prefilter (`tileGeoBounds` vs. the ring's own * bbox) rather than the source's mesh-sampling/loose-footprint heuristics — * those exist there to avoid walking every triangle of city-scale national * tilesets before an exact clip; at this library's current single-tileset * (BIM model) scale, bbox-prefilter-then-exact-clip is both simpler and * already correct (a tile outside the ring exact-clips to zero triangles * regardless), and the same geometric pipeline this module already needs * is reused straightforwardly if the heuristic layer becomes worth adding. * * No textures: BIM/IFC materials are flat colors, not textured meshes, so * the UV/image plumbing the source implementation carries is dead weight * here — dropped rather than kept for a case this library doesn't have. * Each triangle's own source color IS carried through, though — baked as * per-vertex `COLOR_0` (see `resolvePrimitiveColor`/`buildGlb`), not left * as an undifferentiated flat gray. * * PURE geometry/binary-writing core (this file) + a thin DOM-touching * driver (`region-export-run.ts`) that resolves the live tileset registry * and triggers the browser download — same split as terrain-sample.ts / * terrain-heightfield.ts. */ export type LngLatRing = Array<[number, number]>; /** Closed (first === last) + CCW — committed draw rings arrive closed, previews open; both normalize the same way. */ export declare function normalizeRing(ring: LngLatRing): LngLatRing; export interface B3dmBatchTable { /** batchLength: number of features encoded in the glb's `_BATCHID`; each property array below must have this length. */ batchLength: number; /** Plain-JSON per-feature properties — entry i is feature i's value. Omit for a structurally-valid b3dm with no property data. */ properties?: Record; } export interface RegionExportResult { bytes: Uint8Array; triangleCount: number; format: "glb" | "b3dm"; } /** * Clip every loaded tile's triangles across ALL given tilesets against * `ring`, re-frame the clipped result to a local ENU frame at the ring's * own centroid (portable — most viewers can't display ECEF-scale * coordinates), and pack it as GLB or b3dm. `null` when the ring or the * clip produces nothing (an empty region, or a ring drawn where nothing is * loaded) — the caller reports that distinctly from a thrown error. */ export declare function computeRegionExport(ring: LngLatRing, tilesets: Map, options?: { format?: "glb" | "b3dm"; }): RegionExportResult | null;