Skip to content

Commit da42164

Browse files
jbaehrlooooo
authored andcommitted
Use expression as inner_diameter for cycloid gear
The cycloid gear is created with a default number of teeth of 15 and an `inner_diameter` of 7.5. That is half the number of teeth and results in an hypocycloid going orthogonal from the pitch circle right to the center. This change now replaces the hard coded value "7.5" with the expression "teeth / 2" so that this straight hypocycloid is kept, even if the number of teeth is adapted. This allows easy reduction of the number of teeth (down to two, in fact) without the recomputation to fail.
1 parent 73f6b7f commit da42164

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

freecad/gears/features.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ def __init__(self, obj):
606606
obj.teeth = 15
607607
obj.module = '1. mm'
608608
obj.inner_diameter = 7.5
609-
obj.outer_diameter= 7.5
609+
obj.outer_diameter = 7.5
610610
obj.height = '5. mm'
611611
obj.thickness = '5 mm'
612612
obj.beta = '0. deg'
@@ -863,8 +863,8 @@ def __init__(self, obj):
863863
obj.gear = self.cycloid_tooth
864864
obj.teeth = 15
865865
obj.module = '1. mm'
866-
obj.inner_diameter = 7.5
867-
obj.outer_diameter = 7.5
866+
obj.setExpression('inner_diameter', 'teeth / 2') # teeth/2 makes the hypocycloid a straight line to the center
867+
obj.outer_diameter = 7.5 # we don't know the mating gear, so we just set the default to mesh with our default
868868
obj.beta = '0. deg'
869869
obj.height = '5. mm'
870870
obj.clearance = 0.25

0 commit comments

Comments
 (0)