r/OCCT • u/Mammoth_Profession66 • 6h ago
Keep fillets on the right edge in an OCCT-based CAD: naming faces by provenance instead of by hash
Hi, I've been building an open-source parametric CAD on OpenCascade for the last ten months (Bezier, GPL, desktop app with OCCT compiled to WebAssembly). Friends and I use it to design parts for a particle accelerator for a youth science competition. I wanted to share how I dealt with topological naming, because this sub is probably the one place where people care about the details.
The problem, measured: I rebuilt an identical model and compared face hashes. 0 of 6 stayed the same. So any feature that stores "face 7" or a geometry hash breaks as soon as you touch an earlier step.
What Bezier does instead: every face gets a name from where it came from, a feature ID plus a tag, resolved through each operation's evolution data. So it's not "face 7", it's "side 2 of extrude 1" (`F:extrude-1:side-2`). Since OCCT only reports evolution for faces, edges are named as the intersection of two named faces, and vertices as a set of faces. Geometry signatures are only used to break ties between siblings that came from the same origin.
The kernel is my own OCCT build with a few extra operations (face tweak, and defeature that keeps its history), based on occt-wasm by Andy Mai. There are about 1,800 unit tests, some of them against the real kernel. It handles the full Voron 2.4 STEP (241 MB) with a live section view, pictures attached.
Details are in docs/architecture.md and packages/core/src/stable-ref.ts: github.com/ProfessorEngineergit/Bezier
AI DISCLAIMER: Parts of primarily the frontend were worked on with agents, however I did read the code.
