Gears adjust size based on smallest gear

This commit is contained in:
Christian Colglazier 2022-05-22 20:21:38 -04:00
parent eb0379dff2
commit 9462e22b3c

View File

@ -39,6 +39,7 @@ gear_gap=0.2
gear_offset=0.5 gear_offset=0.5
large_gear_diameter=8.5 large_gear_diameter=8.5
gear_thinkness=10 gear_thinkness=10
sg_teeth=11
# Other # Other
mount_gap=2 mount_gap=2
@ -70,6 +71,7 @@ support_x = (support_y-b)/slope
lg_x=support_x-stepper_center[0] lg_x=support_x-stepper_center[0]
lg_y=support_y-stepper_center[1] lg_y=support_y-stepper_center[1]
lg_radius = (math.sqrt(lg_x**2 + lg_y**2)-sg_teeth*mod/2)
def findRodInter(n_x, n_y): def findRodInter(n_x, n_y):
p = Point(center_x, center_y) p = Point(center_x, center_y)
@ -155,7 +157,7 @@ lid = lid.faces('>Z[1]').workplane().center(stepper_center[0], -stepper_center[1
.circle(5).extrude(lid_thicknesss-wall_width) .circle(5).extrude(lid_thicknesss-wall_width)
lid = lid.faces('>Z[0]').workplane().circle(5/2).cutThruAll() lid = lid.faces('>Z[0]').workplane().circle(5/2).cutThruAll()
base = base.faces('<Z[1]').workplane().center(lg_x, lg_y).circle(26.5).cutBlind(-gear_thinkness-gear_gap) base = base.faces('<Z[1]').workplane().center(lg_x, lg_y).circle(lg_radius+2*mod).cutBlind(-gear_thinkness-gear_gap)
base = base.faces('<Z[2]').workplane().hLine(support_radius, forConstruction=True)\ base = base.faces('<Z[2]').workplane().hLine(support_radius, forConstruction=True)\
.threePointArc((-support_radius,-support_radius/2),(0,support_radius))\ .threePointArc((-support_radius,-support_radius/2),(0,support_radius))\
.polarLine(support_radius, -slant_degree)\ .polarLine(support_radius, -slant_degree)\
@ -200,12 +202,12 @@ lid = lid.faces('<Z[0]').workplane().circle(m3_head_diameter/2).cutBlind(-m3_hea
# Gears # Gears
l_gear = cq.Workplane('XY').gear(SpurGear(module=mod, l_gear = cq.Workplane('XY').gear(SpurGear(module=mod,
teeth_number=63, teeth_number=math.ceil(lg_radius*2/mod),
width=gear_thinkness, width=gear_thinkness,
bore_d=large_gear_diameter)) bore_d=large_gear_diameter))
l_gear = l_gear.translate((21+stepper_center[0],20.15+stepper_center[1],(gear_thinkness+gear_offset)/2)) l_gear = l_gear.translate((lg_x+stepper_center[0], lg_y+stepper_center[1], (gear_thinkness-gear_gap)/2))
s_gear = cq.Workplane('XY').gear(SpurGear(module=mod, s_gear = cq.Workplane('XY').gear(SpurGear(module=mod,
teeth_number=11, teeth_number=sg_teeth,
width=gear_thinkness)) width=gear_thinkness))
@ -217,7 +219,7 @@ copy = s_gear.faces('<Z[0]').workplane().vLine(tab_distance, forConstruction=Tru
.close().cutThruAll() .close().cutThruAll()
s_gear = s_gear.faces('<Z[0]').sketch().circle(shaft_diameter/2).finalize().cutThruAll() s_gear = s_gear.faces('<Z[0]').sketch().circle(shaft_diameter/2).finalize().cutThruAll()
s_gear = s_gear.add(copy) s_gear = s_gear.add(copy)
s_gear = s_gear.translate((stepper_center[0],stepper_center[1],(gear_thinkness+gear_offset)/2)) s_gear = s_gear.translate((stepper_center[0],stepper_center[1],(gear_thinkness-gear_offset)/2))
# Render # Render
show_object(base, name='Follow Focus Base') show_object(base, name='Follow Focus Base')