From a1b14a183e5814b14efa4ad3199e6a514339c196 Mon Sep 17 00:00:00 2001 From: Christian Colglazier Date: Sat, 21 May 2022 18:45:40 -0400 Subject: [PATCH] Cleaned code --- follow_focus.py | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/follow_focus.py b/follow_focus.py index 0d8a061..e49018f 100644 --- a/follow_focus.py +++ b/follow_focus.py @@ -6,23 +6,33 @@ import math from shapely.geometry import LineString from shapely.geometry import Point +# M3 screws for attaching lid +m3_tap=2.5 +m3_head_diameter=6 +m3_head_depth=3 +m3_passthrough=3.5 + +# Fastener dimensions +fastener_width = 11 +fastener_height = 3.5 +fastener_length = 20 + +# NEMA 17 stepper motor +stepper_motor_size=42 + +# Case 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 large_gear_diameter=8.5 -m3_tap=2.5 -m3_head_diameter=6 -m3_head_depth=3 -m3_passthrough=3.5 -#m_hole_diameter=6 -#m_hole_depth=3 + 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))) @@ -37,6 +47,7 @@ angle=40 outer_ring_diameter=rod_thickness+2*loop_thickness center_x=end_x-math.cos(math.radians(angle))*outer_ring_diameter/2 center_y=end_y-math.sin(math.radians(angle))*outer_ring_diameter/2 +gear_gap=0.2 def findRodInter(n_x, n_y): p = Point(center_x, center_y) @@ -74,7 +85,6 @@ def createOutline(ex_amount): base = base.edges('|Z and >Y').fillet(outer_fillets) base = base.edges('|Z and 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() -gear_gap=0.2 base = base.faces('