PD: Make the involute gear's toogh length configurable

Exposing the addednum and dedendum coefficients as properties allows to
change the tooth length above and below the pitch circle. This makes it
possible to use the profile beyond standard full-depth systems, e.g. for
stub tooths and most importantly: involute splined shafts and hubs.

Gear objets created with earlier versions automatically get the
additional properties on document restore. Its values match the hard-
coded values used in earlier versions.

There is a change when creating *new* internal gear profiles, though:
Previously, an addendum coefficient of 0.6 was used, presumably to reduce
the tip length beyond the base circle in order to avoid a non-involute
edge. This method is one proposal from the "Handbook of Gear Design" by
Gitin M. Maitra, as referenced in the original source code comments.

However, Maitra also states that this reduction of the anual gear's tip
in turn requires an enlagement of the mating gear of 1.25 instead of the
ordinary 1.0. And it is only required for a low numer of teeth and/or the
mating gear being quite large (less than 10 teeth in difference, to avoid
interferences).
Because those additional requirements and conditions have not been
implemented, the previously used values have been incomplete anyway. Thus
I decided to not implemented this special case and use the standard
values of 1.0/1.25 for newly created external and internal gears alike.
Internal gears need special care for other kind of interference anyway
and the newly exposed properties now allow to do so.

There is no entry in the task panel for those advanced properties yet.
This commit is contained in:
Jonas Bähr
2023-01-10 21:20:31 +01:00
committed by Uwe
parent d8118a4b11
commit 37595da316
3 changed files with 85 additions and 14 deletions

View File

@@ -87,7 +87,10 @@ class _InvoluteGear:
def ensure_property(type_, name, doc, default):
if not hasattr(obj, name):
obj.addProperty(type_, name, "Gear", doc)
setattr(obj, name, default)
if callable(default):
setattr(obj, name, default())
else:
setattr(obj, name, default)
ensure_property("App::PropertyInteger", "NumberOfTeeth",
doc="Number of gear teeth",
@@ -104,14 +107,18 @@ class _InvoluteGear:
ensure_property("App::PropertyBool", "ExternalGear",
doc="True=external Gear False=internal Gear",
default=True)
ensure_property("App::PropertyFloat", "AddendumCoefficient",
doc="The height of the tooth from the pitch circle up to its tip, normalized by the module.",
default=lambda: 1.0 if obj.ExternalGear else 0.6)
ensure_property("App::PropertyFloat","DedendumCoefficient",
doc="The height of the tooth from the pitch circle down to its root, normalized by the module.",
default=1.25)
def execute(self,obj):
#print "_InvoluteGear.execute()"
w = fcgear.FCWireBuilder()
if obj.ExternalGear:
involute.CreateExternalGear(w, obj.Modules.Value,obj.NumberOfTeeth, obj.PressureAngle.Value, obj.HighPrecision)
else:
involute.CreateInternalGear(w, obj.Modules.Value,obj.NumberOfTeeth, obj.PressureAngle.Value, obj.HighPrecision)
generator_func = involute.CreateExternalGear if obj.ExternalGear else involute.CreateInternalGear
generator_func(w, obj.Modules.Value, obj.NumberOfTeeth, obj.PressureAngle.Value,
split=obj.HighPrecision, addCoeff=obj.AddendumCoefficient, dedCoeff=obj.DedendumCoefficient)
gearw = Part.Wire([o.toShape() for o in w.wire])
obj.Shape = gearw
obj.positionBySupport();