BIM pipeline¶
bim-svc is active from M4 (validation + viewer) and M5 (metadata
extraction + zoning compare). Large IFC files never enter the FastAPI request
path; uploads are direct-to-GCS, and all validation, extraction, and tiling
run on dedicated GKE workers.
Pipeline stages¶
flowchart TD
U["① Upload<br/>PSP PUT IFC direct to GCS via signed URL"]
V["② Integrity & format validation<br/>IfcOpenShell<br/>· IFC2x3 / IFC4 schema<br/>· file hash + corruption check<br/>· authoring-tool metadata<br/>· naming convention"]
M["③ Metadata extraction (M5)<br/>· building height, storey count, GFA<br/>· site / lot reference<br/>· georef / coordinate system"]
T["④ Tile generation<br/>IFC → XKT tiles (async worker)<br/>cache per submission + revision"]
Z["⑤ Zoning overlay (M5)<br/>fetch zoning envelope from Masterplan GIS<br/>compute exceedance (height / setback / plot ratio)"]
VWR["⑥ Viewer<br/>xeokit in SPA<br/>pan · zoom · rotate · section · measure<br/>floor toggle · lot boundary · zoning envelope<br/>visual compliance checklist (M4)<br/>federated view (M5)"]
U --> V
V -->|ok| M
V -->|ok| T
M --> Z
V -->|failed| FAIL["bim.validation.completed<br/>reasons[]"]
V --> EV1[bim.validation.completed]
M --> EV2[bim.metadata.extracted]
Z --> EV3[bim.zoning.exceedance.flagged]
T --> VWR
Why uploads bypass FastAPI¶
Large IFC files would pin FastAPI worker threads and dominate bandwidth. The upload handshake:
sequenceDiagram
autonumber
participant PSP
participant SPA
participant SUB as submission-svc
participant GCS as GCS<br/>siss-uploads
participant BIM as bim-svc (worker)
PSP->>SPA: pick IFC file
SPA->>SUB: POST /submissions/{id}/files/request-upload<br/>(filename, content_type, size)
SUB-->>SPA: V4-signed PUT URL (scoped)
SPA->>GCS: PUT <large IFC>
GCS-->>SPA: 200 OK
SPA->>SUB: POST /submissions/{id}/files/confirm
SUB->>GCS: read metadata + hash
SUB-->>BIM: submission.files.attached
BIM->>GCS: download IFC
BIM->>BIM: validate · extract · tile
BIM-->>SUB: bim.validation.completed<br/>bim.metadata.extracted
Viewer capabilities¶
The xeokit-based viewer in the SPA supports —
- pan / zoom / rotate / section cut
- measure height and distance
- toggle floors and auxiliary layers
- overlay lot boundary (GeoJSON) and zoning envelope
- visual compliance confirmation checklist (M4)
- federated view with neighbouring approved models (M5)
Tiles stream on demand from siss-processed via short-lived signed URLs.
Scale and accuracy gates¶
- Worker pool. BIM validation, extraction, and tiling run on a dedicated GKE node pool; FastAPI is never in the critical path.
- Accuracy golden-set. M5 extraction is measured against a golden set of reference IFC files. The M5 milestone gate is ≥ 90% height accuracy within tolerance. See Testing for the AI eval harness.
Zoning source not yet chosen
The zoning envelope data source for M5 (SI-internal GIS vs. third-party) is an open issue. A stub interface is specified; the real integration depends on the data owner's readiness.