@aeco-dev/viewer
v0.1.3
Published
WebGPU IfcViewer for the browser, built from the AECO fork of IfcOpenShell so it can ship ahead of upstream.
Readme
@aeco-dev/viewer
WebAssembly build of the IfcViewer core from myoualid/IfcOpenShell. This package can include viewer features that are not in IfcOpenShell/IfcOpenShell yet.
dist/build.json records the fork commit and sidecarFormatVersion. The wasm and the .ifcview baker are a pair: a file baked at a different format version will be refused.
Load the Emscripten glue with a script tag so it can request IfcViewerWeb.wasm from the same URL directory. Leave IfcViewerWeb.js unbundled. Load ifcviewer.js after it.
<script src="./node_modules/@aeco-dev/viewer/dist/IfcViewerWeb.js"></script>
<script src="./node_modules/@aeco-dev/viewer/dist/ifcviewer.js"></script>
<script>
const build = await fetch(new URL('./node_modules/@aeco-dev/viewer/dist/build.json', import.meta.url)).then(r => r.json());
const viewer = await IfcViewer.create({
canvas: document.querySelector('#viewer-canvas'),
sidecarFormatVersion: build.sidecarFormatVersion,
});
</script>The canvas element must have id="viewer-canvas".
jsDelivr serves the same pair when the version in the URL matches the published package:
<script src="https://cdn.jsdelivr.net/npm/@aeco-dev/[email protected]/dist/IfcViewerWeb.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@aeco-dev/[email protected]/dist/ifcviewer.js"></script>The viewer is licensed under the GNU LGPL version 3. COPYING and COPYING.LESSER from IfcOpenShell are included in the package.
