Open gumyr opened 12 months ago
Something like the following as described by Discord's drjth:
def plane_from_face(face: Face, align=(Align.CENTER, Align.CENTER)): u = (align[0].value - 1) / 2 v = (align[1].value - 1) / 2 pl = Plane(face) pl.origin = face.position_at(u,v) return pl
w, l1, h, w2, l2 = 5, 10, 2, 5, 4 with BuildPart() as p: with BuildSketch(Plane.XY): Rectangle(w,l1) extrude(amount=h) with BuildSketch(plane_from_face(p.faces().sort_by(Axis.Z)[-1], align=(Align.CENTER, Align.MAX))): Rectangle(w2,l2,align=(Align.CENTER, Align.MAX)) extrude(amount=h)
Not using Align, but the https://build123d.readthedocs.io/en/latest/direct_api_reference.html#geometry.Plane.shift_origin method allows the origin of a Plane to be moved to any position contained within the Plane.
Something like the following as described by Discord's drjth: