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
Use Embind instead of WebIDL #8
Conversation
With this technique, would it eventually be possible to expose the entire OpenCascade API... automatically? If not, this might be a heretical idea, but would it make sense to use the WebIDL to generate the intermediate Also, the informative error messages look really exciting! |
Yeah, I have been playing around with code-generating the bindings a bit today. First, I looked into If the auto-generation script works, I can have it export Embind and WebIDL bindings and then use the WebIDL file to generate the Typescript definitions. I think that would be pretty neat... Your suggestion of using WebIDL as the input for the bindings might also work... Probably, I would have to come up with some additional definitions in the IDL file to mark overloaded methods and constructors, so that the Embind bindings and the Typescript definitions can be created correctly from that file. I'll post here, if I have some updates. |
Have you considered uncommenting the if-always under "Upload Build Products" to see if they're good? It's also possible to append a timeout for the step like so:
That should shave a couple hours off of the timeout step (timing out at an arbitrarily-chosen 3 hours and 20 minutes). Not that it's a long-term solution, but it might help with progress... |
Hi @zalo, I just merged this into the master branch and created a release tagged with I gave up on most of the build system, for the moment. As mentioned before, I think (hope) the build system will come back to life when I split up the library into smaller chunks (which can be loaded on demand, allowing for smaller web apps). I'm sure that there will still be bugs in the library and I would greatly appreciate it if you would report them if you find any. Next up on my todo-list are |
Alrighty; I'll look into porting the standard library to use the new embind overload naming scheme; I'll let you know how it goes 👍 |
It doesn't look like inheritance is handled quite the same way... Is there any way to cast types between each other?
Also, could I trouble you to add the |
Perfect. If you're making any progress regarding the automatically detecting the correct overload, let me know.
That should be in the library already (maybe try out the v1.0.1 builds if it doesn't work in v1.0.0). The interface for static methods changed slightly.
The build is running. Will let you know when it's done. |
New builds are up. Let me know if you need anything else! |
Thanks! I must have missed the Triangulation one because my patch only works on Constructors right now... Unfortunately, the error right after supplying the correct overload of PolygonOnTriangulation is that If it's not a big deal, it would be nice if |
I just implemented bindings for most specializations of the |
...uploaded new builds ✌️. |
It looks like there's an issue where the array got included twice :(
It would be cool to run MakeBottle as a separate Github Action unit test (triggered on each commit etc.) |
(oops, sorry, Github formatting clobbered the actual error before, it's been edited to include it now) |
Thanks for that. Yeah, I agree that it would be good to have testing. I will put that on my list... I'm running another build which will hopefully work better. |
Can you try the new builds? Bottle example is working fine, here. |
This pull request will implement the bindings to OCCT using Emscripten's Embind instead of the current WebIDL approach.
The advantages:
Code conventions / How-To:
embind
folder. Start with main.cpp and then look at the header files in that folder.Current limitations:
Other improvements:
Next steps:
Any comments would be welcome, particularly from @zalo, @guidovanhilst, @ancorasir, @Johnly1986 (because you guys have actually already used this library 🙂)