$ show ThatOpen/engine_web-ifc
This is a software library for parsing and processing IFC (Industry Foundation Classes) BIM files, primarily designed for web environments. It consists of a C++ core that reads IFC STEP files, resolves geometry (including extrusions, sweeps, Boolean CSG operations, and advanced curves like B-splines and clothoids), and generates triangulated meshes. The C++ code is compiled to WebAssembly via Emscripten, and a TypeScript API (IfcAPI) exposes all functionality to JavaScript applications in both browser and Node.js. The library supports multiple IFC schema versions (IFC2X3, IFC4, IFC4X3) and includes a schema generator that produces C++ and TypeScript type definitions from EXPRESS schema files. The architecture is a classic native-to-web bridge: the C++ library handles all heavy geometry and parsing, while the TypeScript layer provides a clean interface for loading models, streaming meshes, reading/writing properties, and creating new geometry. Key entry points include the IfcAPI class (open/close models, load geometry, save models), the C++ IfcGeometryProcessor and IfcGeometryLoader for mesh generation, and the IfcLoader for token-based IFC parsing. External dependencies include GLM (math), spdlog (logging), mapbox/earcut (triangulation), and CDT (constrained Delaunay triangulation). A comprehensive test suite using real IFC files and regression hash checks ensures geometry stability across versions. The library is production-ready but shows some technical drift: pinned dependency commits, large monolithic source files, and generated schema headers that must be manually regenerated. It remains actively maintained with CI/CD pipelines, issue triage, and regular releases (v0.0.78).
The LLM identified 2 files worth highlighting for reuse:
A self-contained boolean engine (fuzzybools) for CSG operations on 3D meshes. It provides plane/line/point abstraction, point deduplication via spatial grid, plane-plane and line-line intersection, 2D inside-outside tests, and constrained triangulation. This component can be extracted and reused in any 3D application needing robust boolean operations without external dependencies beyond basic math.
A token stream class that provides a push/move/read interface for consuming IFC STEP data. It handles tape-based token chunks, configurable memory limits, and line-oriented parsing. The interface is generic enough to be adapted for any similar text-based data format (e.g., STEP, IGES). It is a clean, reusable parsing primitive that minimizes coupling to IFC-specific logic.