# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false from build123d import * from svgpathtools.path import transform def build_mop_scraper_holder(center_thickness: float): mop_diameter = 23.4 mop_arc_size = 240 scraper_diameter = 20.3 scraper_arc_size = mop_arc_size arms_thickness = 3 clamp_length = 30 screw_diameter = 4.75 screw_head_diameter = 9.6 screw_head_depth = 4 with BuildPart() as mop_scraper_holder: with BuildSketch() as profile: with BuildLine(): arc_s = 170 mop_arc = CenterArc((0, (mop_diameter + center_thickness) / -2), mop_diameter / 2, 90 - (arc_s / 2), arc_s) scraper_arc = CenterArc((0, (scraper_diameter + center_thickness) / 2), scraper_diameter / 2, (arc_s / 2) - 90, -arc_s) Line(mop_arc @ 0, scraper_arc @ 0) Line(mop_arc @ 1, scraper_arc @ 1) screw_pos = scraper_arc @ 0.5 make_face() mop_arm = CenterArc((0, (mop_diameter + center_thickness) / -2), mop_diameter / 2, 90 - (mop_arc_size / 2), mop_arc_size) offset(mop_arm, amount=arms_thickness, side=Side.RIGHT) make_face() scraper_arm = CenterArc((0, (scraper_diameter + center_thickness) / 2), scraper_diameter / 2, (scraper_arc_size / 2) - 90, -scraper_arc_size) offset(scraper_arm, amount=arms_thickness, side=Side.LEFT) make_face() extrude(profile.sketch, clamp_length / 2) extrude(profile.sketch, -clamp_length / 2) fillet(mop_scraper_holder.edges().filter_by(Axis.Z), (arms_thickness - 0.01) / 2) with Locations(Plane((screw_pos.X, screw_pos.Y, 0)).rotated((-90, 0, 0))): CounterBoreHole(screw_diameter / 2, screw_head_diameter / 2, screw_head_depth) return mop_scraper_holder def build_mop_handle(): mop_diameter = 23.8 thickness = 5 hand_curve_length = 70 hand_curve_thickness = 5 hand_curve_spacing = 50 hand_curve_thumb_space = 10 hand_curve_pinky_space = 20 flared_base_thickness = hand_curve_thickness flared_base_length = 5 screw_diameter = 4.75 screw_head_diameter = 9.6 screw_head_depth = 2 rounding = 5 handle_radius = (mop_diameter / 2) + thickness handle_length_total = flared_base_length + hand_curve_pinky_space + (hand_curve_length * 2) + hand_curve_spacing + hand_curve_thumb_space with BuildPart() as mop_handle: with BuildSketch(Plane.XZ): with BuildLine() as profile: sl = Line((0, 0), (handle_radius, 0)) fb = ThreePointArc(sl @ 1, (handle_radius + flared_base_thickness, (sl @ 1).Y + (flared_base_length / 2)), (handle_radius, (sl @ 1).Y + flared_base_length)) hs1 = Line(fb @ 1, (handle_radius, (fb @ 1).Y + hand_curve_pinky_space)) h1 = ThreePointArc(hs1 @ 1, (handle_radius + hand_curve_thickness, (hs1 @ 1).Y + (hand_curve_length / 2)), (handle_radius, (hs1 @ 1).Y + hand_curve_length)) hs2 = Line(h1 @ 1, (handle_radius, (h1 @ 1).Y + hand_curve_spacing)) h2 = ThreePointArc(hs2 @ 1, (handle_radius + hand_curve_thickness, (hs2 @ 1).Y + (hand_curve_length / 2)), (handle_radius, (hs2 @ 1).Y + hand_curve_length)) hs3 = Line(h2 @ 1, (handle_radius, (h2 @ 1).Y + hand_curve_thumb_space)) el = Line(hs3 @ 1, (0, (hs3 @ 1).Y)) Line(el @ 1, sl @ 0) make_face() Rectangle((handle_radius + flared_base_thickness) * 2, 10, align=(Align.CENTER, Align.MAX), mode=Mode.SUBTRACT) revolve() fillet(mop_handle.edges().sort_by(Axis.Z)[1:], rounding) with Locations(Plane((0, 0, handle_length_total - thickness))): Cylinder(mop_diameter / 2, 99999, align=(Align.CENTER, Align.CENTER, Align.MAX), mode=Mode.SUBTRACT) # this is a seem channel with BuildSketch(Location((0, mop_diameter / 2, handle_length_total - thickness))): Triangle(A=90, b=1, c=1) extrude(amount=-99999, mode=Mode.SUBTRACT) with Locations(Plane((0, 0, flared_base_length + hand_curve_pinky_space + hand_curve_length + (hand_curve_spacing / 2)))): with PolarLocations(handle_radius, 2): with Locations(Rotation(0, 90, 0)): CounterBoreHole(screw_diameter / 2, screw_head_diameter / 2, screw_head_depth) with Locations(Plane((0, 0, flared_base_length + (hand_curve_pinky_space / 2)))): with PolarLocations(handle_radius, 2, 90): with Locations(Rotation(0, 90, 0)): CounterBoreHole(screw_diameter / 2, screw_head_diameter / 2, screw_head_depth) return mop_handle mop_scraper_holder_top = build_mop_scraper_holder(15) assert mop_scraper_holder_top.part is not None export_step(mop_scraper_holder_top.part, "mop_scraper_holder_top.step") mop_scraper_holder_bottom = build_mop_scraper_holder(10) assert mop_scraper_holder_bottom.part is not None export_step(mop_scraper_holder_bottom.part, "mop_scraper_holder_bottom.step") mop_handle = build_mop_handle() assert mop_handle.part is not None export_step(mop_handle.part, "mop_handle.step")