Comments (4)
Hi,
this is one of the limitations coming from the differences of how JavaScript and C++ work. The C++ function BRepTools::UVBounds
takes in references to Standard_Real
, which translates to a Number
type in JavaScript. JavaScript does not support passing arguments as reference (only as shallow copy). I think this limitation only applies to built-in datatypes like float, double (or Standard_Real
), int, char, etc.
In my understanding, there is currently no way to achieve this without modifying the OpenCascade API (with some Getter functions) and recompiling the library against this change. A change can be applied as a patch, so that there is a chance that it won't break with new releases of OpenCascade. There are already some similar patches in the 1.1.1 version of OpenCascade.js, like this one.
I will open an issue in the Emscripten repository and ask if someone has a better workaround for this issue. If not, I will create the patch, which will then become part of the upcoming 2.0 release.
from opencascade.js.
Thank you for the explanation and for looking into it! There's no urgency, and it's super nice that it will be addressed in 2.0. Also nice to know that there are ways to patch these things, I hope Emscripten team will have some ideas as well ;)
Your answer definitely saves me from banging against the wall. I suspected that there's something different about this one. Otherwise opencascade.js works amazing so far... Have to integrate few more basic features and will ship first experimental release.
from opencascade.js.
Very happy to hear that 🙂!
It would be great if you would share your results and issues, if you find more.
from opencascade.js.
Have a look at this post with an example on how to achieve this using a custom build.
As for the general solution to the problem of passing references to built-in datatypes: That will come eventually, but it might take a while.
from opencascade.js.
Related Issues (20)
- Nuxt3 template
- Build emcc crashes HOT 4
- How to iterate over NCollection_List?
- MultiThreaded build on the browser gives errors related to node environment HOT 2
- CI costs too much time when building ocjs HOT 5
- Is there a better way to add cpp code? HOT 2
- How to import brep file with opencascade.js? HOT 1
- null function or function signature mismatch when building shell from solid HOT 2
- How to access data from .write() HOT 2
- Custom Build: XCAFDoc_DocumentTool.ShapeTool is not a function
- Is It possible to export a image to SVG?
- can i modify or replace a shape for an assembly ? (Adding new shape replacing the old opencascade shape)
- How to config opencascade.js in next.js? HOT 1
- How to build only a few specific modules of occ
- Cannot bind the library with Vite HOT 1
- Noob question : about .step export
- Update opencascade to 7.8.0 HOT 1
- Few errors during custom build
- Project Maintenance Status? HOT 1
- Custom build no-exceptions.yml failed. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencascade.js.