Skip to content

Adds ifclite...#1

Open
louistrue wants to merge 11 commits into
textonym:mainfrom
louistrue:add-ifclite-parse
Open

Adds ifclite...#1
louistrue wants to merge 11 commits into
textonym:mainfrom
louistrue:add-ifclite-parse

Conversation

@louistrue
Copy link
Copy Markdown

No description provided.

claude added 11 commits March 18, 2026 17:24
Remove the offline IFC→GLB conversion + Three.js render pipeline
(ifc-lite/parser, ifc-lite/geometry, ifc-lite/renderer, three,
GLTFLoader, OrbitControls) and replace with @ifc-lite/embed-sdk —
a lightweight iframe SDK that provides native IFC parsing, WebGPU
rendering, and a rich feature set out of the box.

Changes:
- Remove @ifc-lite/parser, @ifc-lite/geometry, @ifc-lite/renderer,
  three, @types/three dependencies; add @ifc-lite/embed-sdk
- Rewrite visual.ts to use IFCLiteEmbed iframe API with Power BI
  cross-filtering via entity-selected/entity-deselected events
- Remove src/ifcViewer.ts (Three.js scene management no longer needed)
- Simplify settings.ts (scene settings card removed — viewer handles
  its own rendering controls)
- Update capabilities.json with descriptive dataRole for model URL
- Update license to "MIT AND MPL-2.0" and add LICENSES/MPL-2.0.txt
- Rewrite README with new architecture, feature list, and CORS docs

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
18 tests covering:
- Constructor (container creation, selection manager init)
- update() with no data, empty rows, invalid URL, empty string
- update() with valid URL (embed creation, correct options)
- URL deduplication (same URL skips reinit)
- URL change (destroys old embed, creates new)
- Data removal (destroys embed)
- Cross-filtering (entity-selected → selectionManager.select,
  entity-deselected → selectionManager.clear)
- Selection ID building from data view rows
- Error handling (shows/clears .ifc-error overlay)
- Rapid sequential URL changes

Coverage: 100% statements, 100% lines, 100% functions, 92.85% branches.

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
…derer

Power BI's sandbox CSP blocks iframes to external domains, preventing
the embed-sdk approach from working. This replaces it with a direct
Three.js WebGL renderer that uses @ifc-lite/geometry to parse IFC files
into mesh data rendered in-canvas — no iframe, no CSP issues.

- Add ifcThreeViewer.ts: Three.js viewer with streaming IFC geometry
- Update visual.ts to use IfcThreeViewer instead of IFCLiteEmbed
- Keep @ifc-lite/embed-sdk in deps (unchanged, not removed)
- Add three, @types/three, @ifc-lite/geometry as dependencies
- Update tests for the new Three.js-based approach (11/11 pass)
- Add skipLibCheck for @ifc-lite/wasm Symbol.dispose types

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
Installing locally ensures webpack resolves project dependencies
(three, @ifc-lite/geometry) correctly during pbiviz start.

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
- Add postinstall script to patch pbiviz webpack config, inlining
  .wasm files as base64 data URLs (PBI sandbox serves assets from
  its own domain, breaking CORS for separate WASM chunks)
- Add WebAccess privilege to capabilities.json so the visual can
  fetch external IFC model URLs from within the sandbox
- Make geometry processor init non-fatal so the render loop starts
  even if WASM loading fails

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
The PBI sandbox rewrites asset URLs to app.powerbi.com, breaking
WASM loading. Fix by:

- Adding scripts/inline-wasm.mjs to base64-encode the @ifc-lite/wasm
  binary into src/wasm-inline.ts (auto-generated, gitignored)
- Calling initSync() with inlined bytes before GeometryProcessor.init()
- Updating postinstall to generate the inline module on npm install

The WASM is now embedded in visual.js (~1.2 MB base64), eliminating
the separate .wasm chunk that the sandbox couldn't load.

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
The previous URL (IFCjs/test-ifc-files) returns 404 as the repo
no longer exists.

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
The PBI sandbox runs without 'allow-same-origin', so accessing
window.localStorage throws SecurityError. The logger's typeof
check triggers the getter which throws. Wrap in try/catch via
postinstall patch script.

https://claude.ai/code/session_01NWBvXa9iQUdrtamHCXyx3L
@louistrue
Copy link
Copy Markdown
Author

@textonym hope it helps...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants