bschwind / opencascade-rs

Rust bindings to the OpenCascade CAD Kernel
GNU Lesser General Public License v2.1
118 stars 22 forks source link

Convert from opencascade native types to wrapper types #127

Open TomiS opened 1 year ago

TomiS commented 1 year ago

At the moment most types are defined like this:

pub struct Shape {
    pub(crate) inner: UniquePtr<ffi::TopoDS_Shape>,
}

I think it might be useful to be able to use the low level ffi directly and then convert the result to Shape (or Edge or whatever) somehow. I didn't find any way to do it because the inner field is defined as public only on crate level. Am I missing something?

bschwind commented 1 year ago

@TomiS what sort of code are you writing where you would want this?

We could probably just expose the field via a getter, though the point of the higher level wrapper is to avoid having to use the ffi types.