How thatopen/engine_fragment works
Project type and purpose
• This is an open-source, node/ browser library (“Fragments”) for storing, displaying, navigating, and editing massive BIM (Building Information Modeling) data.
• It provides:
• A binary format defined via FlatBuffers schemas
• A TypeScript/JavaScript importer/exporter (IfcImporter) for IFC data
• A high-performance 3D viewer built atop Three.js
• Utility modules, multithreading support via Web Workers
• Example/demo pages illustrating integration pathways
File structure
• Top-level monorepo layout:
• /.github, CI/CD configs, package.json, babel/vite/jest configs, examples/ (demo HTML + JS bundles)
• /packages/fragments: the main library
– /flatbuffers: the .fbs schema + FlatBuffers compiler
– /src: core modules, subdivided into
· Importers/IfcImporter (geometry & property processors, file readers)
· Schema (TS definitions mirroring .fbs)
· Utils (event bus, data maps, converters)
– build configs (tsconfig, vite configs)
• Key patterns:
• Layered architecture: Importer → Data Format → Core Engine → Rendering
• Web Worker threads to offload heavy computation (multithreading folder, vite.config-worker.ts)
• Examples folder demonstrating consumption in a browser environment
README for additional insights
• Emphasizes FlatBuffers for cross-platform serialization
• Mentions support for frontend and backend (Node.js) via the same Importer
• Highlights core features: filtering, raycasting, highlighting, snap interactions