SVG-based semantic 3D rendering from ifc-lite geometry #1122
Replies: 1 comment
-
|
Hi @mehmet-ylcnky, good idea and well scoped. One thing up front: don't accept "slower, small models only" as a given. With the right granularity this targets real buildings. Answers in order. 1. Is For semantics, no, by design. Name, GlobalId, type, properties are dropped at the WASM boundary. Join Two things to design around now:
2. Reuse from the 2D pipeline /
What's new is per-frame arbitrary-camera orchestration. The math is there. 3. API stability? 4. Interest as a downstream project? 5. Prior art? 6. Missing deps / look at X?
7. Will it work, and the speed point. Won't work as framed:
On "slow, small models only": the compute scales, projection is cheap and parallel. The only thing that scales with model size is live DOM node count, and you control that. Render at element-outline granularity and bound the visible set with frustum + occlusion + screen-size LOD. Then the live path count stays in the low thousands whether the model is 10k or 10M triangles. Usable on all models is an engineering target, not a fantasy. The work is the culling/LOD pipeline and DOM diffing, not the projection. Build it. Ping me and I'll point you at the exact files per piece. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone, great and extensive work here. Trully appreciate it.
I've been exploring an idea that builds on top of ifc-lite's geometry pipeline, and I'd love to get your thoughts, particularly both on feasibility and whether it's interesting as a downstream project.
The idea
Take ifc-lite's geometry output and render it as interactive 3D SVG, not a static IFC-to-SVG converter, but a live 3D experience (rotate, pan, zoom, click) where every building element is a DOM node you can inspect, style with CSS, navigate with a screen reader.
The approach of this project is like, instead of rasterizing geometry into pixels, it projects 3D geometry into SVG paths, recalculating the projection on every camera change. When you rotate the model, it re-projects all vertices, re-sorts elements by depth, and updates the SVG DOM. The result looks and feels like a 3D viewer, but the underlying representation is a structured vector document.
Every frame is a fresh projection of the 3D model. Drag to rotate --> the WASM kernel multiplies every vertex by the new camera matrix, sorts front-to-back, and patches the SVG paths. It's software 3D rendering, the same thing GPUs do in hardware but outputting to SVG instead of a framebuffer.
Important framing
This is not an attempt to replicate or compete with what ifc-lite's WebGPU renderer achieves. From understanding of the source code, seems like the renderer is already well-optimized for speed, scale, and visual fidelity.
This is an exploration of an alternative rendering representation with fundamentally different trade-offs. It will be slower, limited to smaller models, and visually simpler than ifc-lite's viewer. I accept those limitations by design.
The purpose is to explore what becomes possible when you trade rendering performance for semantic document structure, and to demonstrate that IFC geometry can exist as an interactive, accessible, embeddable vector document.
What it looks like
Instead of sending triangles to WebGPU, take the same
MeshData[]that ifc-lite produces and:<path>elements grouped per IFC elementclass="ifc-wall",data-express-id,aria-labelExpected result: right-click --> Inspect Element on a rotating 3D building:
What ifc-lite components this would use
I plan the project depends on ifc-lite for the hard problem (IFC --> triangles), and figured out following dependencies:
@ifc-lite/parser→IfcParser.parseColumnar()@ifc-lite/geometry→GeometryProcessor.processAdaptive()MeshData[]withexpressIdper meshMeshData.positions/normals/indicesMeshData.expressIdMeshData.color@ifc-lite/data→EntityTable,PropertyTable@ifc-lite/data→SpatialHierarchy@ifc-lite/parser→extractPropertiesOnDemandEverything after geometry extraction (projection, sorting, SVG generation, interaction, accessibility) would be new code in a separate project. ifc-lite does the heavy lifting, this project takes that output and explores a different way of presenting it.
I aim to a proof that IFC geometry can be represented as an interactive semantic vector document, a different answer to a different question than what GPU renderers solve.
Questions for you
Is
MeshData[]fromGeometryProcessorself-contained enough for this? I need positions, normals, indices, expressId, and colors per element. Do I need anything beyond whatprocessAdaptive()yields, or does that cover it?Is there anything in the 2D drawing pipeline (
@ifc-lite/drawing-2d,projection_outline.rs) worth reusing? These exist for section cuts, wondering if any projection/outline logic applies to arbitrary-viewpoint software rendering.Any concerns about depending on
@ifc-lite/geometry's API stability? I'd pin versions, but curious whetherMeshData/GeometryProcessorare considered stable surface.Would this be of interest as a downstream community project? Happy to keep it fully separate, but wanted to check if there's appetite for it in the ecosystem.
Has anyone explored SVG or non-GPU rendering from ifc-lite before? Couldn't find prior art in the repo but wanted to confirm.
Am I missing any dependency for the project idea? or do you have any suggestion like "look at the topic/point X also"?
and finally, I am particularly interested in "this will/won't work because X" feedback. Better to hear it now before diving in.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions