-
-
Notifications
You must be signed in to change notification settings - Fork 112
Compile to wasm #946
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
By "running in browser" do you mean on some other computer (i.e. not locally)? If so, who hosts this computer and how is security provided such that users can enter Python code (and import other packages) without the machine mining bitcoin? |
build123d also depends on OCP, and I agree with the prior comment that compiling to WASM is not trivial. replicad instead depends on OpenCascade.js which hasn't had a commit in about 2 years (possibly a dead project). I agree that making things easier to run is a very important goal, and in some respects installing build123d and a viewer is very unapproachable for a python newcomer. So in summary, I think this is a nice goal but is a huge project unto itself that would require more time than I am willing to devote to it. |
@jdegenstein thanks for clarification! The issue I mentioned is 2y old, I was hoping something has changed in regards of compiling complexity. Can you elaborate where is it come from? Is that a compiling a wasm module or some after chore?
They not just depend on it (install it) but instead make some custom build.
It's ok for newcomers. After all it's python and they should get used to installing stuff (which often breaks) The real benefit would be for the end user(the one who gets the model) and the developers of tools - look at example from replicad - it's a fully configurable, downloadable model, generated right in the browser (even params are taken from ulr). The thingiverse has customizer IFAIK it's based on OpenSCAD. @gumyr Given all that, the benefits go far beyond better newcomer experience - it spreads adoption and distribution significantly. Thanks for your work and time! |
The real issue is that pywrap that is used to build OCP is pretty much undocumented and a veritable pain to understand. If you have experience with build system you could try to take a look. We documented our journey here https://discord.com/channels/964330484911972403/1079454322221396008 |
I did some experimentation with this with the eventual goal of getting build123d running in something like jupyterlite. But in case anyone is interested here's some info. I used the run_docker form pyodide to get a stable environement for tests. Then after cloning OCCT we can build it using something like: cd OCCT
emcmake cmake -G Ninja . \
-DUSE_FREETYPE=OFF \
-DUSE_TK=OFF\
-DBUILD_LIBRARY_TYPE=Static \
-DBUILD_MODULE_ApplicationFramework=OFF \
-DBUILD_MODULE_DETools=OFF \
-DBUILD_MODULE_DataExchange=OFF \
-DBUILD_MODULE_Draw=OFF \
-DBUILD_MODULE_FoundationClasses=ON \
-DBUILD_MODULE_ModelingAlgorithms=ON \
-DBUILD_MODULE_ModelingData=ON \
-DBUILD_MODULE_Visualization=ON
cmake --build .
cmake --build . -- install OCP is unfortunately much harder to compile, and that is where I eventually gave up. But I did get pretty far by adding Emscripten as a new platform whereever it makes sense. Then running the first step of pywrap with |
There is a closed issue: CadQuery/cadquery#1385 claiming that
There is examples of opencascade running in browser, namely replicad. It's not as feature rich, but has much better DX.
I think the benefits of the ability to run the thing in browser are evident. Is that possible?
The text was updated successfully, but these errors were encountered: