-
-
Notifications
You must be signed in to change notification settings - Fork 41
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
how to properly load the full wasm package from opencascade and/or see better errors #156
Comments
I believe you gotta sent to url to the wasm file to your web worker from outside your web worker. (Make the url to the wasm file in your non-webworker then sent the result as a string to your webworker to use inside your webworker on startup). E.g.
Web worker:
Please ignore extra imports, I'm doing copy paste on mobile phone and editing text is a bit hard. |
Be warned the full version of opencascade is a 50Mb wasm file. It will be slow in production. You'll still need to make a custom build. |
To convert that number you get into an error message:
The function |
See this file here how they add that extra C++ function down the bottom: https://github.com/donalffons/opencascade.js/blob/master/builds/opencascade.full.yml You really just need to add the same bit to the bottom of the custom build for replicad. Then you can get the error message from the pointer (number) to the error. |
thx @clinuxrulz I'll take a look and see if I can get it working as you suggest! |
no problem... if possible reach out for a custom build. I.E. edit replicad's yml file for their version and add the extra C++ code to the bottom to extract the error message from the pointer to the error (the number thrown in JS). Sadly I could not custom build opencascade.js through the docker container on my computer. 16 GB of ram was not enough. Probably needed 32 GB. However I have had luck compiling opencascade official version to wasm using emscripten without the docker container, by writing my web-worker in C++ instead of TS and only embind-ing a single function for message passing into/out-of the webworker. I really thought 16GB ram was plenty for coding tasks, but I guess that is not the case these days. |
Good news! I have added a new custom build within opencascade-replicad that supports full exceptions. You can use it in that same way that you use the And the studio has been modified as well to allow for these errors. We will see if they are actually useful! ![]() |
@sgenoud amazing, thank you! |
I'm having trouble loading the full OC wasm. I've changed my worker like:
and now I get the error:
Really, my end goal isn't necessarily to have the full wasm library, but just to get better errors than:
Which I thought the error message is so basic due to the note on the opencascadejs site, but I don't see the
sDISABLE_EXCEPTION_CATCHING
flag in the build config. Am I just doing something wrong for getting the errors?The text was updated successfully, but these errors were encountered: