@@ -53,6 +53,8 @@ enamldef SpurGearProfile(Wire):
5353 # Inside plus clearance
5454 attr root_diameter = base_diameter-fillet_size
5555
56+ alias tooth_profile
57+
5658 func involute_curve(start_angle: float, pitch: float, t: float) -> Point:
5759 # Generate the curve for the contact surface
5860 a = start_angle + t * pi/2
@@ -62,6 +64,7 @@ enamldef SpurGearProfile(Wire):
6264 return Point(c.x + s * sin(a), c.y - s * cos(a))
6365
6466 Wire: tooth_profile:
67+ color = 'green'
6568 Wire: half_tooth_profile:
6669 # Bottom non-contact part of gear
6770 Fillet:
@@ -94,10 +97,10 @@ enamldef SpurGearProfile(Wire):
9497 shape = half_tooth_profile
9598 operations = [Mirror(x=1)]
9699 Looper:
97- iterable = range(tooth_count)
100+ iterable = range(1, tooth_count)
98101 Transform:
99102 shape = tooth_profile
100- operations = [Rotate(angle=pitch_angle*loop.index )]
103+ operations = [Rotate(angle=pitch_angle*loop.item )]
101104
102105
103106enamldef SpurGear(Part):
@@ -150,14 +153,16 @@ enamldef DoubleHelicalSpurGear(Part):
150153 Translate(z=thickness),
151154 ]
152155
156+
153157enamldef Assembly(Part):
154158 Axis:
155159 pass
156- #SpurGear:
157- # profile.addendum_factor = 1.5
158- # profile.tooth_count = 10
160+
161+ SpurGear:
162+ profile.addendum_factor = 1.5
163+ profile.tooth_count = 10
159164 #HelicalSpurGear:
160165 # profile.tooth_count = 20
161166 # position = (0, 10)
162- DoubleHelicalSpurGear:
163- thickness = 5
167+ # DoubleHelicalSpurGear:
168+ # thickness = 5
0 commit comments