No description
| .github/workflows | ||
| scripts | ||
| src-tauri | ||
| tests | ||
| viewer | ||
| .gitattributes | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| embed.html | ||
| index.html | ||
| jsconfig.json | ||
| package-lock.json | ||
| package.json | ||
| playwright.config.js | ||
| README.md | ||
| rollup.config.js | ||
| viewer-settings-example.json | ||
DFG 3D Viewer — JavaScript Library
Three.js-based 3D viewer. Ships as a minified bundle for web/libraries/dfg-3dviewer/ or standalone HTML embeds.
Drupal integration is provided by the separate dfg_3dviewer module.
Build
npm install
npm run build:library
Output in dist/library/:
dfg_3dviewer.min.jsassets/— CSS, draco, IFC WASM, fonts
For local packaging (optional):
npm run pack:library # creates dfg-3dviewer-library.zip (gitignored)
Releases
Tagged pushes build dfg-3dviewer-library.zip in CI and attach it to a GitLab Release.
git tag v1.0.3
git push origin v1.0.3
Download the zip from Releases and extract to web/libraries/dfg-3dviewer/ on Drupal.
Local development
cp viewer/viewer-settings-example.json viewer-settings.json
npm run dev:test
# http://localhost:1234
Install on Drupal
- Download
dfg-3dviewer-library.zipfrom Releases and extract toweb/libraries/dfg-3dviewer/ - Enable the
dfg_3dviewerDrupal module and configure at/admin/config/dfg_3dviewer
Standalone embed
<div id="DFG_3DViewer" 3d="./examples/box.stl"></div>
<script type="module" src="./dfg_3dviewer.min.js"></script>
Or pass config in code: await Viewer.MainInit({ ... }).
Repository layout
viewer/— sourcedist/— build output (gitignored; runnpm run build:libraryor download a Release zip)rollup.config.js— production buildstests/— Playwright E2E