From 2494aeb3aee16cc3eb90491e4ac9bda795806971 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sun, 30 Oct 2016 19:47:06 +0100 Subject: [PATCH] Add play param for FingerJoints --- boxes/edges.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/boxes/edges.py b/boxes/edges.py index 5959b45..91d4c69 100644 --- a/boxes/edges.py +++ b/boxes/edges.py @@ -425,6 +425,7 @@ Values: * height : 1.0 : length of the fingers * width : 1.0 : width of finger holes * edge_width : 1.0 : space below holes of FingerHoleEdge + * play : 0.0 : extra space to allow movement """ @@ -438,6 +439,7 @@ Values: "height": 1.0, "width": 1.0, "edge_width": 1.0, + "play" : 0.0, } class FingerJointBase: @@ -474,6 +476,11 @@ class FingerJointEdge(BaseEdge, FingerJointBase): fingers, leftover = self.calcFingers(length, bedBolts) + if not positive: + play = self.settings.play + f += play + s -= play + leftover -= play self.edge(leftover / 2.0) @@ -542,6 +549,7 @@ class FingerHoles(FingerJointBase): self.boxes.moveTo(x, y, angle) s, f = self.settings.space, self.settings.finger + p = self.settings.play b = self.boxes.burn fingers, leftover = self.calcFingers(length, bedBolts) @@ -556,7 +564,7 @@ class FingerHoles(FingerJointBase): self.boxes.hole(pos + 0.5 * s, 0, d * 0.5) self.boxes.rectangularHole(pos + 0.5 * f, 0, - f, self.settings.width) + f+p, self.settings.width+p) self.ctx.restore()