diff --git a/xmas_spinner.py b/xmas_spinner.py index a2b94a8..ad6d245 100644 --- a/xmas_spinner.py +++ b/xmas_spinner.py @@ -20,13 +20,27 @@ bearing_radius = bearing_diameter / 2.0 bearing_thickness = 6.93 +x_offset = 37.5 +y_offset = 18.9 + +spinner_base = ( + Workplane() + .cylinder(10, 20) + .workplane(offset=-bearing_thickness) + .cylinder(10, bearing_radius) + .workplane(offset=4) + .rect(35, 35, forConstruction=True) + .vertices() + .cylinder(2, 10) +) + spinner = ( Workplane() .workplane(offset=0) - .move(-37.9, 19) + .move(-x_offset, 19) .cylinder(5, 15) .workplane(offset=-2) - .move(-37, 19) + .move(x_offset, y_offset) .cylinder(10, bearing_radius) ) @@ -38,10 +52,10 @@ spinner_split_top = ( tree.workplane(5) .split(keepTop=True) .workplane(offset=-10) - .move(-37, 19) + .move(-x_offset - 0.5, y_offset) .cylinder(10, bearing_radius) .workplane(offset=-2.9) - .move(-37, 19) + .move(-x_offset - 0.5, y_offset) .cylinder(10, bearing_radius + 3) ) @@ -49,17 +63,20 @@ spinner_split_bottom = ( tree.workplane(5) .split(keepBottom=True) .workplane(offset=7.8) - .move(-37.9, 19) + .move(-x_offset, y_offset) .cylinder(bearing_thickness, bearing_or, combine="cut") .workplane(offset=6.8) - .move(-37.9, 19) + .move(-x_offset, y_offset) .cylinder(20, bearing_radius, combine="cut") .workplane(offset=-3.0) - .move(-37.9, 19) + .move(-x_offset, y_offset) .cylinder(13.3, 15) .workplane(offset=-7.12) - .move(-37.9, 19) + .move(-x_offset, y_offset) .cylinder(bearing_thickness + 3.3, bearing_or, combine="cut") + .workplane(offset=-7.12) + .move(-x_offset, y_offset) + .cylinder(15, bearing_radius, combine="cut") ) cq.exporters.export(spinner, "/home/deck/model_files/xmas_spinner.stl") @@ -67,8 +84,9 @@ cq.exporters.export(spinner_split_top, "/home/deck/model_files/xmas_spinner_top. cq.exporters.export( spinner_split_bottom, "/home/deck/model_files/xmas_spinner_bottom.stl" ) +cq.exporters.export(spinner_base, "/home/deck/model_files/xmas_spinner_base.stl") try: - show_object(spinner_split_bottom) + show_object(spinner_split_top) except NameError: pass