fix computed property dw

This commit is contained in:
lorenz
2022-12-15 18:25:44 +01:00
committed by GitHub
parent 29e45aa613
commit ba87611235

View File

@@ -188,8 +188,9 @@ class InvoluteGear(BaseGear):
"computed", "outside diameter", 1)
obj.addProperty("App::PropertyLength", "df",
"computed", "root diameter", 1)
obj.addProperty("App::PropertyLength", "traverse_module", "traverse module of the generated gear", 1)
obj.addProperty("App::PropertyLength", "dw", "computed", "The pitch diameter.")
obj.setExpression('dw', 'teeth * module') # calculate via expression to ease usage for placement
obj.setExpression('dw', 'teeth * traverse_module') # calculate via expression to ease usage for placement
obj.setEditorMode('dw', 1) # set read-only after setting the expression, else it won't be visible. bug?
obj.addProperty("App::PropertyAngle", "angular_backlash", "computed",
"The angle by which this gear can turn without moving the mating gear.")
@@ -227,6 +228,9 @@ class InvoluteGear(BaseGear):
# checksbackwardcompatibility:
if "properties_from_tool" in fp.PropertiesList:
fp.gear.properties_from_tool = fp.properties_from_tool
fp.traverse_module = fp.module / np.cos(fp.gear.beta)
else:
fp.traverse_module = fp.module
fp.gear._update()
# computed properties