involute gear: add parameter pitch

+ minimal fix for rack
This commit is contained in:
looooo
2020-04-08 17:56:59 +02:00
parent 84f9a16af7
commit 8193f1ebce
2 changed files with 7 additions and 1 deletions

View File

@@ -110,6 +110,8 @@ class InvoluteGear(object):
"gear", "gear_parameter", "test")
obj.addProperty("App::PropertyLength", "dw",
"computed", "pitch diameter", 1)
obj.addProperty("App::PropertyLength", "transverse_pitch",
"computed", "transverse_pitch", 1)
obj.gear = self.involute_tooth
obj.simple = False
obj.undercut = False
@@ -170,7 +172,9 @@ class InvoluteGear(object):
rw = fp.gear.dw / 2
fp.Shape = Part.makeCylinder(rw, fp.height.Value)
# computed properties
fp.dw = "{}mm".format(fp.gear.dw)
fp.transverse_pitch = "{}mm".format(fp.gear.pitch)
def __getstate__(self):
return None

View File

@@ -48,6 +48,8 @@ class InvoluteTooth():
else:
self.pressure_angle_t = self.pressure_angle
self.m = self.m_n
self.pitch = self.m * np.pi
self.c = self.clearance * self.m_n
self.midpoint = [0., 0.]
self.d = self.z * self.m
@@ -216,7 +218,7 @@ class InvoluteRack(object):
if self.add_endings:
ext1 = teeth[0] + np.array([0., a + b - pitch / 2])
ext2 = teeth[-1] - np.array([0., a + b - pitch / 2])
teeth = [ext1.tolist(), ext1.tolist()] + teeth + [ext2.tolist(), ext2.tolist()]
teeth = [ext1.tolist(), ext1.tolist()] + teeth.tolist() + [ext2.tolist(), ext2.tolist()]
else:
teeth = [teeth[0].tolist()] + teeth.tolist() + [teeth[-1].tolist()]
#teeth.append(list(teeth[-1]))