feat(ifc): add optional IFC preview (BETA) - #275
Conversation
|
The implementation in #276 appears stronger than this draft in several areas, especially around Worker ownership, cancellation/disposal, installed-package validation, browser regression coverage, and general release readiness. I think that structure is probably a better foundation for the final IFC implementation. One capability from this draft that may still be worth preserving is the advanced That Open configuration bridge. In #276, components
fragments
world
model
selectHowever, configuration of the IFC import pipeline itself is mostly internal to the renderer/Worker. This draft explored an additional escape hatch for advanced consumers, conceptually: createIfcRenderer({
thatOpen: {
components: {
// pass-through configuration
},
fragments: {
// Fragments runtime/settings pass-through
},
importer: {
// importer processing options
},
},
configure(context) {
// post-load runtime customization
},
})The intent is not to expose every That Open option as a Flyfish-owned API. Instead, it would allow advanced applications to use supported That Open importer / Fragments settings without requiring a new Flyfish release whenever the underlying libraries introduce additional options. This seems particularly useful for future BIM-specific requirements while keeping the normal Flyfish IFC API small and stable. So my preference would be to keep the more robust architecture from #276, while considering a small, explicitly advanced pass-through for importer / Fragments configuration. |
Summary
.ifc/ BIM preview support for@file-viewer/renderer-3dusing a single pipeline for both small and large files: That Open ComponentsIfcLoader->web-ifc/ WASM -> That Open Fragments + worker -> browser rendering.@file-viewer/capability-ifcand@file-viewer/assets-ifc, rather than addingweb-ifc, Components, Fragments, Worker, or WASM requirements to the default 3D / Engineering / All dependency closure.components,world,fragments,loader,webIfc,importer, andmodel.Related issue
#267
This is intentionally a Draft PR related to the implementation proposal in #267. I would prefer to confirm the architecture and dependency/license approach with maintainers before treating the issue as implemented or ready to close.
Change classification
Verification
pnpm install --frozen-lockfilepnpm --filter @file-viewer/renderer-3d build && pnpm --filter @file-viewer/capability-ifc buildpnpm --filter @file-viewer/renderer-3d type-check && pnpm --filter @file-viewer/capability-ifc type-checkpnpm --filter @file-viewer/assets-ifc verifypnpm audit:renderer-depspnpm exec vitest run test/ifc-optional-capability.spec.tspnpm verify:github-governancepnpm buildpnpm type-checkpnpm testThe Chromium validation uses the committed IFC fixtures and exercises the actual That Open / Fragments runtime rather than a mocked renderer.
It covers regular IFC loading and a forced large-model classification while keeping the same rendering pipeline. It also verifies that the Fragments configuration pass-through reaches the runtime and that the underlying
IfcLoader.webIfcinstance is available through the advanced bridge.These checks validate the current implementation mechanically, but they should not be interpreted as broad production validation of IFC compatibility or performance.
Sample / fixture evidence
test/fixtures/ifc/Building-Architecture.ifctest/fixtures/ifc/Building-Structural.ifcVisual evidence
Risk and compatibility
.ifc;@file-viewer/renderer-3d; new optional@file-viewer/capability-ifc; new optional@file-viewer/assets-ifc;@thatopen/components;@thatopen/fragments;web-ifc; self-hosted Fragments Worker and web-ifc WASM assets.IfcLoader->web-ifc-> Fragments. There is no separate Flyfish directweb-ifcbackend. This is intentional to avoid maintaining duplicate geometry, selection, property, camera, error-handling, and cleanup implementations.web-ifc, That Open Components/Fragments, or their Worker/WASM runtime unless the IFC capability is installed and enabled. It is currently not automatically included in Engineering / All / Full presets.largeModelThresholdBytesdoes not select a different renderer. Small and large IFC files use the same Fragments pipeline. The threshold is only used to avoid optional eager work for models classified as large.maxSourceBytesis an optional deployment policy that can reject a source before initializing the IFC runtime.ifc.thatOpen.components,ifc.thatOpen.fragments, andifc.thatOpen.importerintentionally act as opaque pass-through configuration. Flyfish does not maintain a second schema for those APIs. Advanced runtime objects are exposed asunknown, allowing consumers to use the types/API of the exact That Open version they install without making those third-party types part of Flyfish's stable API.@file-viewer/assets-ifcfiles under the File Viewer runtime asset path.web-ifc@0.0.77is MPL-2.0.@thatopen/components@3.4.8and@thatopen/fragments@3.4.7are MIT. The optional IFC asset package keeps the applicable MPL-2.0 and MIT notices with redistributed runtime assets. I would specifically like maintainer confirmation that this dependency and licensing separation is acceptable before considering the implementation ready for merge.@file-viewer/capability-ifcand@file-viewer/assets-ifc. The normal renderer and existing presets remain independent of the optional IFC engine dependencies.Checklist