Skip to content

Commit 80fbd3d

Browse files
committed
internal gear: don't use expression for dw
1 parent b38bfda commit 80fbd3d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

freecad/gears/features.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,6 @@ def add_limiting_diameter_properties(self, obj):
362362

363363
def add_computed_properties(self, obj):
364364
obj.addProperty("App::PropertyLength", "dw", "computed", "The pitch diameter.")
365-
obj.setExpression('dw', 'teeth * module') # calculate via expression to ease usage for placement
366-
obj.setEditorMode('dw', 1) # set read-only after setting the expression, else it won't be visible. bug?
367365
obj.addProperty("App::PropertyAngle", "angular_backlash", "computed",
368366
"The angle by which this gear can turn without moving the mating gear.")
369367
obj.setExpression('angular_backlash', 'backlash / dw * 360° / pi') # calculate via expression to ease usage for placement
@@ -405,11 +403,11 @@ def generate_gear_shape(self, fp):
405403
fp.gear.backlash = fp.backlash.Value * \
406404
(fp.reversed_backlash - 0.5) * 2. # negate "reversed_backslash", for "internal"
407405
fp.gear.head = fp.clearance # swap head and clearance to become "internal"
408-
# checksbackwardcompatibility:
409-
if "properties_from_tool" in fp.PropertiesList:
410-
fp.gear.properties_from_tool = fp.properties_from_tool
406+
fp.gear.properties_from_tool = fp.properties_from_tool
411407
fp.gear._update()
412408

409+
fp.dw = "{}mm".format(fp.gear.dw)
410+
413411
# computed properties
414412
fp.transverse_pitch = "{}mm".format(fp.gear.pitch)
415413
fp.outside_diameter = fp.dw + 2 * fp.thickness

0 commit comments

Comments
 (0)