A browser BIM coordination viewer: a procedurally generated four-storey building (structural frame, architecture envelope, MEP services) rendered with three.js, and a pure, unit-tested clash-detection engine that finds every place the services run into the structure — the classic clash review, entirely client-side.
Live demo: https://girder.vitaliipopov.dev, no backend, no login
What it shows
- Clash detection as pure logic —
src/model/clash.tsintersects AABBs across discipline pairs (structure/architecture vs MEP) with a touch tolerance, returns overlap volume + centroid, severity-sorted. No three.js imports; pinned by unit tests. - Hard and clearance clashes — besides overlaps, the engine reports clearance (soft) clashes: MEP that sits closer to structure than a required gap, the way coordination reviews flag a duct with no room for insulation or access. Pick the requirement (0 / 100 / 150 / 200 mm); a gap exactly at the limit passes despite float rounding (a bug the tests caught).
- A review queue, not just a list — filter by kind and open/reviewed, step through with J/K (the camera follows), mark items reviewed, and export the filtered report as CSV for the site team's tracker (quoted, formula-injection-safe). Without WebGL the report still works and the 3D view explains why it's missing.
- Deterministic model as code —
src/model/building.tsgenerates the building from grid constants and deliberately mis-routes three MEP runs (duct at beam elevation, pipe through a column line, pipe clipping a soffit). Tests assert every planted error is found and every cleanly routed run stays clash-free — the test suite caught a real routing mistake during development. - Viewer UX from real BIM tools — click a clash: the camera flies to it, the pair lights up red/amber, and the rest of the model turns to glass (isolate-with-ghosted-context, NavisWorks-style). Plus a section plane slider, per-discipline visibility, and a model browser with element counts.
- Imperative 3D behind a small API —
src/viewer/scene.tsowns the render loop; React never re-renders on camera moves. The same host/extension split used when building tooling on top of embedded 3D viewers.
Run it
npm install
npm run dev # vite dev server
npm test # Vitest: clash engine, report, model generator + RTL tests of the review flow
npm run build # tsc + vite
Background
Generalised from production work extending a web-based BIM viewer (three.js-hosted) with coordination tooling — clash/collision checks, work-set grouping and review UI. This is a clean-room, self-contained reproduction of those patterns: same discipline, none of the original code or data.