Fix barbs and spring finger joint types
broken in 13170f0306
Thanks to Tino Hager (https://github.com/tinohager) for reporting!
Resolves: #420
This commit is contained in:
parent
59a6ea549d
commit
dcff72bb47
|
@ -880,17 +880,17 @@ class FingerJointEdge(BaseEdge, FingerJointBase):
|
||||||
description = "Finger Joint"
|
description = "Finger Joint"
|
||||||
positive = True
|
positive = True
|
||||||
|
|
||||||
def draw_finger(self, f, h, style, positive=True):
|
def draw_finger(self, f, h, style, positive=True, firsthalf=True):
|
||||||
t = self.settings.thickness
|
t = self.settings.thickness
|
||||||
|
|
||||||
if positive:
|
if positive:
|
||||||
if style == "springs":
|
if style == "springs":
|
||||||
self.polyline(
|
self.polyline(
|
||||||
0, -90 * p, 0.8*h, (90 * p, 0.2*h),
|
0, -90, 0.8*h, (90, 0.2*h),
|
||||||
0.1 * h, 90, 0.9*h, -180, 0.9*h, 90,
|
0.1 * h, 90, 0.9*h, -180, 0.9*h, 90,
|
||||||
f - 0.6*h,
|
f - 0.6*h,
|
||||||
90, 0.9*h, -180, 0.9*h, 90, 0.1*h,
|
90, 0.9*h, -180, 0.9*h, 90, 0.1*h,
|
||||||
(90 * p, 0.2 *h), 0.8*h, -90 * p)
|
(90, 0.2 *h), 0.8*h, -90)
|
||||||
elif style == "barbs":
|
elif style == "barbs":
|
||||||
n = int((h-0.1*t) // (0.3*t))
|
n = int((h-0.1*t) // (0.3*t))
|
||||||
a = math.degrees(math.atan(0.5))
|
a = math.degrees(math.atan(0.5))
|
||||||
|
@ -909,7 +909,7 @@ class FingerJointEdge(BaseEdge, FingerJointBase):
|
||||||
l = (h+d2) / math.cos(math.radians(a))
|
l = (h+d2) / math.cos(math.radians(a))
|
||||||
poly = [0, 90, d, -180, d+h, -90, 0.5*t, 90+a12, l12, 90-a12,
|
poly = [0, 90, d, -180, d+h, -90, 0.5*t, 90+a12, l12, 90-a12,
|
||||||
0.5*t, 90-a, l, +a, 0, (-180, 0.1*t), h+d2, 90, f-1.7*t, 90-a12, l12, a12, h, -90, 0]
|
0.5*t, 90-a, l, +a, 0, (-180, 0.1*t), h+d2, 90, f-1.7*t, 90-a12, l12, a12, h, -90, 0]
|
||||||
if i < fingers//2:
|
if firsthalf:
|
||||||
poly = list(reversed(poly))
|
poly = list(reversed(poly))
|
||||||
self.polyline(*poly)
|
self.polyline(*poly)
|
||||||
else:
|
else:
|
||||||
|
@ -949,7 +949,8 @@ class FingerJointEdge(BaseEdge, FingerJointBase):
|
||||||
self.bedBoltHole(s, bedBoltSettings)
|
self.bedBoltHole(s, bedBoltSettings)
|
||||||
else:
|
else:
|
||||||
self.edge(s)
|
self.edge(s)
|
||||||
self.draw_finger(f, h, self.settings.style, positive)
|
self.draw_finger(f, h, self.settings.style,
|
||||||
|
positive, i < fingers//2)
|
||||||
|
|
||||||
self.edge(leftover / 2.0, tabs=1)
|
self.edge(leftover / 2.0, tabs=1)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue