refactor: make the mop scraper holder a function
This commit is contained in:
@@ -1,47 +1,51 @@
|
||||
# pyright: reportUnusedCallResult=false, reportWildcardImportFromLibrary=false
|
||||
from build123d import *
|
||||
|
||||
center_thickness = 10
|
||||
def build_mop_scraper_holder():
|
||||
center_thickness = 10
|
||||
|
||||
mop_diameter = 23.7
|
||||
mop_arc_size = 220
|
||||
mop_diameter = 23.7
|
||||
mop_arc_size = 220
|
||||
|
||||
scraper_diameter = 20.55
|
||||
scraper_arc_size = mop_arc_size
|
||||
scraper_diameter = 20.55
|
||||
scraper_arc_size = mop_arc_size
|
||||
|
||||
arms_thickness = 3
|
||||
arms_thickness = 3
|
||||
|
||||
clamp_length = 30
|
||||
clamp_length = 30
|
||||
|
||||
with BuildPart() as mop_scraper_holder:
|
||||
with BuildSketch() as profile:
|
||||
with BuildLine() as connecting_outline:
|
||||
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)
|
||||
with BuildPart() as mop_scraper_holder:
|
||||
with BuildSketch() as profile:
|
||||
with BuildLine() as connecting_outline:
|
||||
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)
|
||||
Line(mop_arc @ 0, scraper_arc @ 0)
|
||||
Line(mop_arc @ 1, scraper_arc @ 1)
|
||||
|
||||
screw_pos = scraper_arc @ 0.5
|
||||
screw_pos = scraper_arc @ 0.5
|
||||
|
||||
make_face()
|
||||
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()
|
||||
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()
|
||||
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)
|
||||
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)
|
||||
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(3 / 2, 5.6 / 2, 3.2)
|
||||
with Locations(Plane((screw_pos.X, screw_pos.Y, 0)).rotated((-90, 0, 0))):
|
||||
CounterBoreHole(3 / 2, 5.6 / 2, 3.2)
|
||||
|
||||
return mop_scraper_holder
|
||||
|
||||
mop_scraper_holder = build_mop_scraper_holder()
|
||||
assert mop_scraper_holder.part is not None
|
||||
export_step(mop_scraper_holder.part, "mop_scraper_holder.step")
|
||||
|
||||
Reference in New Issue
Block a user