Replies: 3 comments
-
I agree this can be a bit confusing, the key is that the default mode for offset is import build123d as bd
box1 = bd.Box(width = 100, length = 100, height = 100)
box1 -= bd.offset(box1, amount = -10) #note the subtraction here
# box1 = bd.split(box1, bd.Plane.XY, keep = bd.Keep.BOTTOM) # to reveal the inside
box2 = bd.Box(width = 100, length = 100, height = 100)
box2 = bd.offset(box2, amount=-10, openings=box2.faces().sort_by(Axis.Z)[-1]) |
Beta Was this translation helpful? Give feedback.
-
Note that |
Beta Was this translation helpful? Give feedback.
-
Thanks, I get it now. The openings parameter acts as though it sets mode=mode.SUBTRACT. I think the underlying mechanism goes a bit deeper than that but I'll stick with that mental model for now. :-) Cheers. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks gumyr for creating an awesome tool.
I am puzzling over the offset() function. I'm trying to create a hollow box with no openings using the example "Offset Part To Create Thin features", but if I leave off the "openings" argument, or set it to None or [], the resulting box is solid. No big deal as I can make the hollow box by subtracting the offset box from the original box, but perhaps the documentation for the offset() function could be updated to reflect this behaviour? Or perhaps the offset+openings functionality could be moved to its own function, hollow() maybe?
Thanks.
#!/usr/bin/env python
import build123d as bd
box = bd.Box(width = 100, length = 100, height = 100)
box = bd.offset(box, amount = -10, openings = [])
box = bd.split(box, bd.Plane.XY, keep = bd.Keep.BOTTOM) # to reveal the inside
bd.export_step(box, "box.step")
Beta Was this translation helpful? Give feedback.
All reactions