Lid lip and stepper motor hole

This commit is contained in:
Christian Colglazier 2022-05-20 18:51:28 -04:00
parent cc699b0336
commit 89b9dfbfd4

View File

@ -9,10 +9,12 @@ slant_degree=15.0
thickness=20
rod_thickness=15.2
loop_thickness=1.5
wall_width=1.6
stepper_motor_size=42
lid_thicknesss = 5
offset=9
part_thinkness=20
gear_thinkness=10
gap = stepper_motor_size * math.sin(math.radians(slant_degree)) / math.sin(math.radians(90-slant_degree))
width = math.sqrt(gap**2 + stepper_motor_size**2 - 2*gap*stepper_motor_size*math.cos(math.radians(90)))
@ -72,7 +74,7 @@ base = createOutline(part_thinkness)
# Shell
copy = base.faces('>>Z[0]').workplane().center(0, -offset-loop_thickness).polarLine(stepper_motor_size, slant_degree).polarLine(-2*stepper_motor_size, 90+slant_degree).hLine(-2*stepper_motor_size).close().cutThruAll()
copy = copy.faces('+Z').workplane().center(0, -offset-loop_thickness).polarLine(2*stepper_motor_size,-slant_degree).vLine(stepper_motor_size).hLine(-2*stepper_motor_size).close().cutBlind(-lid_thicknesss)
base = base.faces('+Z').shell(-1.6)
base = base.faces('+Z').shell(-wall_width)
base = base.add(copy)
base = base.faces('<<Z[0]').workplane().center(0, offset+loop_thickness).polarLine(stepper_motor_size, -slant_degree).polarLine(stepper_motor_size, -slant_degree-3.75).vLine(2*stepper_motor_size).hLine(-2*stepper_motor_size).close().cutBlind(-lid_thicknesss)
@ -80,9 +82,16 @@ base = base.faces('<<Z[0]').workplane().center(0, offset+loop_thickness).polarLi
stepper_hole_width=31.0
stepper_hole_radius=stepper_hole_width/2*math.sqrt(2)
stepper_center = cq.Workplane('XY').center(0, -offset-loop_thickness).lineTo(0, offset).polarLine(stepper_motor_size/2, 90-slant_degree).polarLine(stepper_motor_size/2, -slant_degree).val().endPoint().toTuple()
base = base.faces('>>Z[0]').workplane().center(stepper_center[0], -stepper_center[1]).circle(22.5/2).pushPoints([(stepper_hole_radius*math.cos(math.radians(45+slant_degree)),stepper_hole_radius*math.sin(math.radians(45+slant_degree))), (stepper_hole_radius*math.cos(math.radians(135+slant_degree)),stepper_hole_radius*math.sin(math.radians(135+slant_degree))),(stepper_hole_radius*math.cos(math.radians(225+slant_degree)),stepper_hole_radius*math.sin(math.radians(225+slant_degree))),(stepper_hole_radius*math.cos(math.radians(315+slant_degree)),stepper_hole_radius*math.sin(math.radians(315+slant_degree)))]).circle(3/2).cutBlind(-1.6)
base = base.faces('>>Z[0]').workplane().center(stepper_center[0], -stepper_center[1]).circle(22.5/2).pushPoints([(stepper_hole_radius*math.cos(math.radians(45+slant_degree)),stepper_hole_radius*math.sin(math.radians(45+slant_degree))), (stepper_hole_radius*math.cos(math.radians(135+slant_degree)),stepper_hole_radius*math.sin(math.radians(135+slant_degree))),(stepper_hole_radius*math.cos(math.radians(225+slant_degree)),stepper_hole_radius*math.sin(math.radians(225+slant_degree))),(stepper_hole_radius*math.cos(math.radians(315+slant_degree)),stepper_hole_radius*math.sin(math.radians(315+slant_degree)))]).circle(3/2).cutBlind(-wall_width)
lid = lid.cut(base)
copy = lid.faces('>>Z[0]').workplane().center(0, -offset-loop_thickness).polarLine(stepper_motor_size*2, slant_degree).polarLine(-2*stepper_motor_size, 90+slant_degree).hLine(-3*stepper_motor_size).close().cutThruAll()
lid = lid.faces('>Z[0]').shell(.000001-wall_width)
lid = lid.add(copy)
lid = lid.faces('>Z[1]').workplane().center(stepper_center[0], -stepper_center[1]-offset-loop_thickness).circle(5).extrude(lid_thicknesss-wall_width)
lid = lid.faces('>Z[0]').workplane().circle(5/2).cutThruAll()
# Render
show_object(base, name='Follow Focus Base')