FreeCAD in the Browser
4 hours ago
- #CAD
- #OpenSource
- #WebAssembly
- LibreCAD and OpenSCAD were compiled to WebAssembly running in browser tabs using a recipe: Qt for WebAssembly, JSPI, a static dependency stack, and audit of threads, filesystems, and OpenGL.
- FreeCAD, a parametric 3D CAD with ~1.5 million lines of C++ and 700k Python, was ported to WebAssembly in ~4 days, running in a browser tab with a first load of ~96 MB compressed.
- The port required building Qt from source with JSPI for modal dialogs, static linking of all modules (no dlopen), and a fixed-function OpenGL emulator for Coin3D's rendering.
- Key challenges included OpenGL emulation, JSPI migration, PySide6 bindings for WebAssembly, and cross-compiling VTK and SMESH for the FEM workbench, with fixes for crashes and performance.
- The port maintains desktop feature parity: 17+ workbenches, Python scripting with PySide6, FEM with real mesh geometry, persistence via IndexedDB, and import/export functionality.
- The engineering was done by Fable (AI), with human direction, bug reporting, and environment setup; full session transcripts and source are available for verification.