Code Monkey home page Code Monkey logo

Comments (4)

donalffons avatar donalffons commented on May 22, 2024 1

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.

 avatar commented on May 22, 2024

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.

donalffons avatar donalffons commented on May 22, 2024

Very happy to hear that 🙂!
It would be great if you would share your results and issues, if you find more.

from opencascade.js.

donalffons avatar donalffons commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.