OCP.wasm: OpenCascade in WebAssembly (build123d now runs in the browser) #1876
yeicor
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've successfully compiled OpenCascade and the OCP Python wrapper to WebAssembly using Pyodide, enabling build123d to run entirely in the browser. You can try it out here: 👉 Simple demo 👉 Complex demo.
(Note: the initial load is a bit slow, but editing and re-running code is faster.)
All the porting code and build artifacts are available here: 🔧 OCP.wasm.
The web-based viewer, which also supports CadQuery models (if not using the playground mode), is here: 🧰 Yet Another CAD Viewer.
This setup makes it possible to share editable parametric CAD models directly in the browser, making it ideal for:
Since both build123d and CadQuery use the same OCP wrapper, it's theoretically possible to get most of CadQuery running in the browser as well (note:
vtk
is unsupported and has been removed from the build). I focused on ensuring build123d tests pass, which already required quite a bit of patching, so I won’t be extending this to CadQuery myself, but the groundwork is here if someone else wants to take it further.Beta Was this translation helpful? Give feedback.
All reactions