opencascade-rs icon indicating copy to clipboard operation
opencascade-rs copied to clipboard

Add section API

Open tymokvo opened this issue 10 months ago • 2 comments

Summary

  • Add wrapper around BRepAlgoAPI_Section class
  • Add casting function to wrapper.hxx
  • Add tests
  • Add section example

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.

tymokvo avatar May 06 '25 18:05 tymokvo

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.

bschwind avatar May 09 '25 08:05 bschwind

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.

tymokvo avatar May 12 '25 11:05 tymokvo

Thanks for the help and for making a great library!

tymokvo avatar Jun 02 '25 14:06 tymokvo