bschwind / opencascade-rs

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

Support the `anchor` argument from BOSL2, if it makes sense #151

Open DeflateAwning opened 1 year ago

DeflateAwning commented 1 year ago

Just wanted to move the discussion from https://github.com/bschwind/key-ripper/issues/55 over here!

The anchor argument from BOSL2 allows you to specify which side/face is at the origin when constructing elementary elements (e.g., cylinders, cuboids, etc).

For example, cuboid([width, length, height], anchor=CENTER); creates a cuboid (rectangular prism) with its center at the origin, while cuboid([width, length, height], anchor=BOTTOM); creates a cuboid with that is centered, but with its bottom face at the origin.

It's possible you created a different, ergonomic way of creating things like this, but I just wanted to bring this up. Haven't had a chance to delve deep otherwise though. Seems like an awesome project!

bschwind commented 1 year ago

Ohhh, I see! I think it would be fairly easy to provide an anchor-based API for primitive construction. I'll keep that in mind as I develop this crate more :)