- Rust 80.2%
- Python 10.5%
- CSS 6.6%
- Dockerfile 1.2%
- WGSL 1.1%
- Other 0.4%
| assets | ||
| src | ||
| .containerignore | ||
| .gitignore | ||
| AGENTS.md | ||
| build.rs | ||
| Cargo.lock | ||
| Cargo.toml | ||
| config.toml | ||
| Containerfile | ||
| customize-freecad-model.py | ||
| Dioxus.toml | ||
| install-freecad-addon.py | ||
| README.md | ||
| run-container | ||
This is a web app to customize FreeCAD models and export as 3MF or STL.
The server clones git repos containing FreeCAD models, the web client lets the user customize the models in those repos.
Making compatible FreeCAD models
Compatible FreeCAD models have a VarSet object named "VarSet". The variables in this VarSet are exposed on the web form for customization.
Compatible repos have the following directory structure:
REPO/
├── README.md Optional repo documentation.
├── MODEL0.FCStd First model (filename is anything matching `*.FCStd`).
├── MODEL0.md Optional documentation of the first model.
├── MODELn.FCStd Any number of additional models.
└── MODELn.md Each model may have optional documentation.
The models can have any number of VarSets, and any number of Spreadsheets. This project only exposes and customizes the variables in the primary/default VarSet, named "VarSet".
Developer info
This project uses Dioxus fullstack:
-
The backend runs the FreeCAD python console to read and write the model's variables, and to export the model's body objects as 3MF.
-
The frontend presents a form of all the variables, and uses WGPU/WASM to display the customized mesh in the browser.
Inspired by the Perplexing Labs Gridfinity Generator: https://gridfinity.perplexinglabs.com/
Install
apt install pkg-config libssl-dev
cargo install dioxus-cli
Serve
dx serve --platform web --debug-symbols false --release
The --debug-symbols false flag is required — without it wasm-opt crashes
with SIGABRT on DWARF debug info. See https://github.com/DioxusLabs/dioxus/issues/5119
To serve in release mode on a specific address:
dx serve --addr ${ADDR} --platform web --release --debug-symbols false