@@ -188,8 +188,13 @@ def add_computed_properties(self, obj):
188
188
"computed" , "outside diameter" , 1 )
189
189
obj .addProperty ("App::PropertyLength" , "df" ,
190
190
"computed" , "root diameter" , 1 )
191
- obj .addProperty ("App::PropertyLength" , "dw" ,
192
- "computed" , "pitch diameter" , 1 )
191
+ 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 .setEditorMode ('dw' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
194
+ obj .addProperty ("App::PropertyAngle" , "angular_backlash" , "computed" ,
195
+ "The angle by which this gear can turn without moving the mating gear." )
196
+ obj .setExpression ('angular_backlash' , 'backlash / dw * 360° / pi' ) # calculate via expression to ease usage for placement
197
+ obj .setEditorMode ('angular_backlash' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
193
198
obj .addProperty ("App::PropertyLength" , "transverse_pitch" ,
194
199
"computed" , "transverse_pitch" , 1 )
195
200
@@ -225,7 +230,6 @@ def generate_gear_shape(self, fp):
225
230
fp .gear ._update ()
226
231
227
232
# computed properties
228
- fp .dw = "{}mm" .format (fp .gear .dw )
229
233
fp .transverse_pitch = "{}mm" .format (fp .gear .pitch )
230
234
fp .da = "{}mm" .format (fp .gear .da )
231
235
fp .df = "{}mm" .format (fp .gear .df )
@@ -350,7 +354,13 @@ def add_limiting_diameter_properties(self, obj):
350
354
"computed" , "root diameter" , 1 )
351
355
352
356
def add_computed_properties (self , obj ):
353
- obj .addProperty ("App::PropertyLength" , "dw" , "computed" , "pitch diameter" , 1 )
357
+ obj .addProperty ("App::PropertyLength" , "dw" , "computed" , "The pitch diameter." )
358
+ obj .setExpression ('dw' , 'teeth * module' ) # calculate via expression to ease usage for placement
359
+ obj .setEditorMode ('dw' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
360
+ obj .addProperty ("App::PropertyAngle" , "angular_backlash" , "computed" ,
361
+ "The angle by which this gear can turn without moving the mating gear." )
362
+ obj .setExpression ('angular_backlash' , 'backlash / dw * 360° / pi' ) # calculate via expression to ease usage for placement
363
+ obj .setEditorMode ('angular_backlash' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
354
364
obj .addProperty ("App::PropertyLength" , "transverse_pitch" , "computed" , "transverse_pitch" , 1 )
355
365
obj .addProperty ("App::PropertyLength" , "outside_diameter" , "computed" , "Outside diameter" , 1 )
356
366
@@ -394,7 +404,6 @@ def generate_gear_shape(self, fp):
394
404
fp .gear ._update ()
395
405
396
406
# computed properties
397
- fp .dw = "{}mm" .format (fp .gear .dw )
398
407
fp .transverse_pitch = "{}mm" .format (fp .gear .pitch )
399
408
fp .outside_diameter = fp .dw + 2 * fp .thickness
400
409
# checksbackwardcompatibility:
@@ -876,7 +885,6 @@ def __init__(self, obj):
876
885
obj .head = 0
877
886
obj .head_fillet = 0
878
887
obj .root_fillet = 0
879
- obj .dw = obj .module * obj .teeth
880
888
obj .Proxy = self
881
889
882
890
def add_helical_properties (self , obj ):
@@ -898,7 +906,13 @@ def add_cycloid_properties(self, obj):
898
906
obj .addProperty ("App::PropertyFloat" , "outer_diameter" , "cycloid" , "outer_diameter divided by module (epicycloid)" )
899
907
900
908
def add_computed_properties (self , obj ):
901
- obj .addProperty ("App::PropertyLength" , "dw" , "computed" , "pitch diameter" , 1 )
909
+ obj .addProperty ("App::PropertyLength" , "dw" , "computed" , "The pitch diameter." )
910
+ obj .setExpression ('dw' , 'teeth * module' ) # calculate via expression to ease usage for placement
911
+ obj .setEditorMode ('dw' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
912
+ obj .addProperty ("App::PropertyAngle" , "angular_backlash" , "computed" ,
913
+ "The angle by which this gear can turn without moving the mating gear." )
914
+ obj .setExpression ('angular_backlash' , 'backlash / dw * 360° / pi' ) # calculate via expression to ease usage for placement
915
+ obj .setEditorMode ('angular_backlash' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
902
916
903
917
def generate_gear_shape (self , fp ):
904
918
fp .gear .m = fp .module .Value
@@ -976,6 +990,13 @@ def __init__(self, obj):
976
990
"The arc length on the pitch circle by which the tooth thicknes is reduced." )
977
991
obj .addProperty ("App::PropertyPythonObject" , "gear" , "base" , "test" )
978
992
obj .addProperty ("App::PropertyAngle" , "beta" ,"helical" , "angle used for spiral bevel-gears" )
993
+ obj .addProperty ("App::PropertyLength" , "dw" , "computed" , "The pitch diameter." )
994
+ obj .setExpression ('dw' , 'teeth * module' ) # calculate via expression to ease usage for placement
995
+ obj .setEditorMode ('dw' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
996
+ obj .addProperty ("App::PropertyAngle" , "angular_backlash" , "computed" ,
997
+ "The angle by which this gear can turn without moving the mating gear." )
998
+ obj .setExpression ('angular_backlash' , 'backlash / dw * 360° / pi' ) # calculate via expression to ease usage for placement
999
+ obj .setEditorMode ('angular_backlash' , 1 ) # set read-only after setting the expression, else it won't be visible. bug?
979
1000
obj .gear = self .bevel_tooth
980
1001
obj .module = '1. mm'
981
1002
obj .teeth = 15
0 commit comments