Skip to content

Commit ba87611

Browse files
authored
fix computed property dw
1 parent 29e45aa commit ba87611

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

freecad/gears/features.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,9 @@ def add_computed_properties(self, obj):
188188
"computed", "outside diameter", 1)
189189
obj.addProperty("App::PropertyLength", "df",
190190
"computed", "root diameter", 1)
191+
obj.addProperty("App::PropertyLength", "traverse_module", "traverse module of the generated gear", 1)
191192
obj.addProperty("App::PropertyLength", "dw", "computed", "The pitch diameter.")
192-
obj.setExpression('dw', 'teeth * module') # calculate via expression to ease usage for placement
193+
obj.setExpression('dw', 'teeth * traverse_module') # calculate via expression to ease usage for placement
193194
obj.setEditorMode('dw', 1) # set read-only after setting the expression, else it won't be visible. bug?
194195
obj.addProperty("App::PropertyAngle", "angular_backlash", "computed",
195196
"The angle by which this gear can turn without moving the mating gear.")
@@ -227,6 +228,9 @@ def generate_gear_shape(self, fp):
227228
# checksbackwardcompatibility:
228229
if "properties_from_tool" in fp.PropertiesList:
229230
fp.gear.properties_from_tool = fp.properties_from_tool
231+
fp.traverse_module = fp.module / np.cos(fp.gear.beta)
232+
else:
233+
fp.traverse_module = fp.module
230234
fp.gear._update()
231235

232236
# computed properties

0 commit comments

Comments
 (0)