feat(bim): integrate portable IFC viewer, project map and prepared layers

This commit is contained in:
DCCONSTRUCTIONS
2026-11-14 18:49:43 +03:00
parent a49fb00b8e
commit cd27a5e483
18 changed files with 365 additions and 1 deletions
+37
View File
@@ -0,0 +1,37 @@
# Portable BIM module in Mission Core
Qualified on 2026-11-14: **Данные → Архитектурные проекты** at the canonical `http://127.0.0.1:8000/`. The operator can create a project, upload IFC, wait for Worker conversion, download the prepared product and view it in 3D or plan. MapLibre, project tree, model versions and visibility share the same catalog. Map markers, project eyes and version rows enter the same project viewer.
## Ownership and integration
The implementation belongs to [NODEDC_BIM_MOD](https://git.dcserve.ru/dctouch/NODEDC_BIM_MOD), branch `feat/portable-bim-ifc`. Core consumes Python host services 0.1.0 and browser workspace 0.1.1 from `vendor/bim/`; release manifests hold source commits and SHA-256 identities. The Python package owns contracts, project documents, transfer lifecycle and the host API. The browser package owns catalog, intake, map and renderer. It uses the host's React and NODE.DC UI, while keeping its Three/Fragments graph private; render objects are not exchanged with existing Core renderers.
Core-specific files are `src/k1link/web/bim_module.py`, `apps/control-station/src/workspaces/data/ArchitecturalProjectsWorkspace.tsx` and asset declarations. The app mounts `/api/v1/bim`, closes the module on shutdown and runs its ready-copy retention with the existing reaper. Product registry/composition select the workspace. The generic shell reads capability status; no BIM pipeline is implemented in App.tsx. The adapter emits canonical toasts, observed by the current Core notification history. It does not depend on that history's source files.
The backend admits only the local operator boundary (loopback peer, loopback Host and same-origin browser requests). This is not a multi-tenant authorization model. It initializes lazily and reports storage/connection failures without blocking unrelated Core workspaces. Local copy admission uses Core's shared physical-disk reservation ledger and its 2 GiB reserve, rather than a separate hard directory quota.
## Data and execution
Under `data_dir/architectural-projects/`, `documents` contains durable catalog, version references, selection and placement; `ready-copies` contains selected immutable renderable products and copy metadata. `connection` contains private Worker binding and a separately protected service token. Do not commit it. The independent module documents `WorkerBinding` configuration and validates allowed HTTP/SSH transport. The qualified path uses the existing SSH alias to a fixed API pipe inside the Worker container; no public port or extra sidecar was introduced.
Worker 006 owns **one** `ndc-bim-worker`, its `ndc-bim-data` volume, installed IFC converter, SQLite queue, Sources and published products. The qualified image is `sha256:edee7bea327ea017cd5717df000e1666c5adf8c02d10d478ff2f9851b30d2ea2` (module source `60e1de66a631f3d34671480823ff48fe0c567d21`). It has an internal network, no published ports or Docker socket, read-only root, UID 10001 and 2 CPU / 4 GiB / 128 PID limits. Other Worker containers and the existing PlayCanvas simulation were not changed by this integration.
Raw IFC streams through Core to the Worker; it is not spooled into Core data. Worker paths are readable Latin project/material/version directories with content deduplication. Local removal retains catalog references and Worker ownership. Re-download restores the same immutable product without conversion. Pin and active viewer leases protect local copies; unpinned inactive copies follow retention. Downloads currently use one active transfer and bounded in-memory status records, without restart-resume. No local IFC conversion fallback exists.
## Verified behavior
The real UI uploaded a six-element IFC twice as separate versions and the public That Open `school_str.ifc` (8,593,426 bytes, SHA-256 `82c3406c11cdf83a7ad00e2155bdcfdef50877e491e780623824161d8955b340`). Worker produced **1,526** geometric elements for the school; its `model.frag` is 708,042 bytes, SHA-256 `18b362ea65aeba88f57dfd011a1f4ce8cb1b5e607aa8f2b9aec9790624b7d381`.
The building renders as real geometry in 3D and on MapLibre, with editable metadata, coordinates, height, yaw and representative BIM version. Example coordinates are explicitly arbitrary, not its surveyed position. Map entry and direct version entry after reload open the same saved project. Plan/3D, fit, fullscreen/Escape, visibility and a 700 px narrow composition were checked. Computed typography uses 13 px operational text, 12 px descriptions and 18 px window titles.
One local version was removed through the UI and downloaded again: references remained and its Worker generation stayed 1. Pins persisted. Worker archive inspection found all three source receipts, a shared inode for the duplicate IFC versions and no scratch files; Core's architectural-project runtime contained no IFC. The source file selected by the user remains their own input outside Core storage. Success notices reached the existing history. Typed failures are wired to the same adapter; live UI fault injection was not completed.
Validation passed: 63 module Python tests, one Node reader regression, four client contract tests, two Core adapter tests, architecture/typecheck/typography gates, 1,596 frontend unit tests and production build. A fast-publication race is covered: a published job with no product in the preceding catalog snapshot keeps polling until publication appears. Both the repeated version and school import completed without a manual refresh.
Full evidence and limitations: [module qualification](https://git.dcserve.ru/dctouch/NODEDC_BIM_MOD/src/branch/feat/portable-bim-ifc/docs/ifc-ui-qualification.md). Canonical Ops reference: [MISSIONCOR-100](https://ops.nodedc.ru/nodedc/browse/MISSIONCOR-100).
## Remaining scope
This is the first IFC slice, not full BIM acceptance. LAS/LAZ and new Gaussian captures, full BIM properties/selection/measurements/sections/federation, placement gizmos and unsaved-draft flow, large-model qualification, persistent download resume, full live fault injection, a second host and physical volume migration remain open. Existing PlayCanvas simulation is a separate system. Map markers cover all placed projects; detailed BIM geometry currently belongs to the selected project's preview. Multiple simultaneous building previews remain an acceptance case.
The 256 MiB prepared-member budget does not guarantee arbitrary GPU/RAM capacity. WebGL was visually qualified. Optional Fragments WebGPU imports produce build warnings and WebGPU is not claimed; multiple Three instances are expected across the private module graph and existing host renderers. The four scoped PASS cases in the module matrix do not close the remaining 139 cases.