Add section API
Summary
- Add wrapper around
BRepAlgoAPI_Sectionclass - Add casting function to
wrapper.hxx - Add tests
- Add
sectionexample
Description
Hello,
I have been evaluating CAD libraries in the rust ecosystem for a project at work. In order to test out some of the capabilities of opencascade-rs, I took a stab at implementing a simple wrapper around the BRepAlgoAPI_Section class.
The most complicated aspect was dealing with the inherited methods from the BRepAlgoAPI class hierarchy. I followed the advice from an issue on cxx on how to deal with this, hence the addition to wrapper.hxx.
Would this be a useful addition? I know that it's a bit rough right now, I haven't used cxx before! Would love to hear any feedback on this direction, though.
Hi @tymokvo, thanks for the PR! And sorry for the late response on it.
I skimmed through the PR and it's looking good, thanks for adding an example as well!
Just FYI, the next thing I hope to accomplish in this repo is to have a more systematic approach to generating the bindings.
This includes logically organizing the OpenCascade modules into equivalently named Rust modules. You can see a manual example of that process in this PR:
https://github.com/bschwind/opencascade-rs/pull/199
But obviously manually creating those are a pain, so I'm also working on generating them by parsing the C++ headers with tree-sitter and writing out the Rust code automatically. That work is happening in the tree-sitter branch.
I just wanted to give you an idea of what I hope this crate will turn into in the future. I'll try to give this a closer review soon.
The work on the tree-sitter branch is looking cool, happy to see that! Writing the bindings manually in one giant file is definitely not super fun.
Thanks for the help and for making a great library!