FoundationPartsPrimitivesBox

Box

Box(center, w, h, d) is a rectangular solid centered on center. w and h are the side lengths in the sketch X and Y directions; d is the depth along the sketch normal.

def __init__(self, w=20, h=30, d=10):
        s = Sketch(self.xy())
        # Box(center, w, h, d) desugars to an Extrusion of a Rectangle.
        self.add_operation(Box(s.origin, w=w, h=h, d=d))
        self.paint("light_blue")

Box desugars at DAG time into an Extrusion of a Rectangle, so anywhere you’d reach for Extrusion(Rectangle.from_center_and_sides(...), end=d), Box is the shorter form.