Files
editor/apps/ifc-converter
d1b40aa98d editor: level-scoped alignment, reference-floor symbols & registry slab tool (#373)
* feat(editor): level-scoped alignment, reference-floor registry symbols, registry slab tool

- Scope alignment candidates to the active level so a node directly below
  on another floor no longer snaps (alignment is XZ-only); building-scoped
  nodes like elevator shafts stay in the pool across floors.
- Derive the elevator alignment footprint from its outer shaft (not the
  inset cab), so its guide actually surfaces within the snap threshold.
- Extract shared stair footprint geometry (rotateXZ, segment transforms,
  stairFootprintAABB) so opening-sync and alignment anchors derive the
  chain identically; stairs now contribute plan bbox anchors.
- Render reference-floor stairs/roofs/elevators/shelves/spawns through
  their registry floorplan builders for pixel-identical symbols.
- Move slab creation to the registry-driven slab tool (parity with
  ceiling); 2D handlers only maintain draft state.
- Lift the 3D alignment guide ribbon to the active level's Y each frame.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* refactor(core): registry-drive elevator/stair alignment footprints

Address architecture review of the level-scoped alignment work: the core
anchor bridge (`alignment-anchors.ts`) hardcoded `if (node.type === 'elevator')`
and `if (node.type === 'stair')` branches to derive their plan footprints.
Move that onto the kinds themselves via a new `alignmentFootprint` capability
so the bridge dispatches generically — matching the registry composition model.

- Add `Capabilities.alignmentFootprint`: returns a `box` (rotatable rect
  centred on position, relocatable for movable kinds) or an `aabb` (already
  resolved, for non-rectangular plan shapes). Elevator uses `box` (its outer
  shaft, and it's movable); stair uses `aabb` (segment chain / annular sector,
  moves by origin).
- Drop both hardcoded branches; the bridge now consults the capability via
  `floorFootprint` (box) and a unified `alignmentAABB` (box ∪ aabb).
- Export `stairFootprintAABB` from core so the stair definition consumes it.
- Tests register synthetic defs carrying the capability (the bridge no longer
  knows elevator/stair by name), reproducing the production glue from the same
  core helpers.
- Document why `REFERENCE_REGISTRY_KINDS` is a deliberate editor-local
  curation, not an auto-derived set (most floorplan-builder kinds shouldn't
  appear as standalone reference symbols, and "reference floor" is an editor
  concept core must not know).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(editor): hide node arrow handles during thumbnail capture

The arrow-handle rig lives on SCENE_LAYER (so its chevrons read as proper
3D plates), but the thumbnail camera only filters EDITOR_LAYER + GRID_LAYER —
so a node selected at capture time would leak its arrows into the snapshot.
Hide the rig on `thumbnail:before-capture` and restore it on
`thumbnail:after-capture`, the same emitter handshake SelectionManager uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-04 16:04:14 -04:00
..

IFC → Pascal Converter

A web app that converts IFC building models into Pascal scene-graph JSON and previews the result in the real @pascal-app/viewer. Drop in an .ifc file (or pick a bundled example), inspect what was extracted, and download the JSON to load into the Pascal editor.

⚠️ Early alpha

This converter is in early alpha. IFC is a sprawling, loosely-followed standard and real-world exports vary wildly — so expect rough edges: misplaced or missing elements, walls that default to a fixed height when their geometry can't be read, items skipped entirely, and element types that aren't mapped yet. The output is meant for previewing and iterating, not production.

Contributions very welcome — if you hit a file that converts badly, a sample IFC + a note on what's wrong is hugely helpful, and PRs improving the conversion (better geometry extraction, more element types, edge-case handling) are exactly what this needs. Jump in. 🙏

How it works

  • @pascal-app/ifc-converter (packages/ifc-converter) — the pure conversion logic. Parses IFC via web-ifc, maps elements onto Pascal node schemas from @pascal-app/core. No DOM, no React.
  • This app — the UI: drop zone, example picker, element search/filters, the 3D preview, and JSON download.

Develop

bun dev   # from this directory, or `turbo run dev` at the repo root

The web-ifc.wasm binary is copied into public/ automatically on install/dev/build (scripts/copy-web-ifc-wasm.mjs). Large example IFCs are fetched from a public bucket at runtime; the small ones are committed under public/test-ifc-files/. Override the bucket with NEXT_PUBLIC_IFC_EXAMPLES_BASE_URL.

Known limitations (help wanted)

  • Plain IFCWALL (Brep/mapped geometry) falls back to a default height — exact per-wall heights need geometry-AABB extraction.
  • Items (furniture, etc.) are skipped — Pascal items require a catalog asset.
  • Beams have no Pascal node type yet and are skipped.
  • Doors/windows are matched to walls by proximity when the IFC omits fill relationships; matching isn't perfect.
  • Stairs/roofs are placeholders (bounding box / flat polygon in metadata).