from build123d import * densa = 7800 / 1e6 # carbon steel density g/mm^3 densb = 2700 / 1e6 # aluminum alloy densc = 1020 / 1e6 # ABS with BuildPart() as p: with BuildSketch() as s: Rectangle(115, 50) with Locations((0, 0)): SlotOverall(90, 12, mode=Mode.SUBTRACT) extrude(amount=15) with BuildSketch(Plane.XZ.offset(50 / 2)) as s3: with Locations((-115 / 2 + 26, 15)): SlotOverall(42 + 2 * 26 + 12, 2 * 26, rotation=90) zz = extrude(amount=-12) split(bisect_by=Plane.XY) edgs = p.part.edges().filter_by(Axis.Y).group_by(Axis.X)[-2] fillet(edgs, 9) show_object(p) # debug(s3) # debug(edgs) # got_mass = p.part.volume*densa # want_mass = 797.15 # tolerance = 1 # delta = abs(got_mass - want_mass) # print(f"Mass: {got_mass:0.2f} g") # assert delta < tolerance, f'{got_mass=}, {want_mass=}, {delta=}, {tolerance=}'