From a7afc8b1b6d83e3ca5162510be6b23f1653f5309 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Wed, 4 May 2022 22:19:35 +0200 Subject: [PATCH] Add stackable top edge with finger holes --- boxes/edges.py | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/boxes/edges.py b/boxes/edges.py index 79b826a..97f67f3 100644 --- a/boxes/edges.py +++ b/boxes/edges.py @@ -961,11 +961,13 @@ Values: if self.angle > 260: raise ValueError("StackableSettings: 'angle' is too big. Use value < 260") - def edgeObjects(self, boxes, chars="sSš", add=True, fingersettings=None): + def edgeObjects(self, boxes, chars="sSšŠ", add=True, fingersettings=None): fingersettings = fingersettings or boxes.edges["f"].settings edges = [StackableEdge(boxes, self, fingersettings), StackableEdgeTop(boxes, self, fingersettings), - StackableFeet(boxes, self, fingersettings)] + StackableFeet(boxes, self, fingersettings), + StackableHoleEdgeTop(boxes, self, fingersettings), + ] return self._edgeObjects(edges, boxes, chars, add) class StackableBaseEdge(BaseEdge): @@ -1031,6 +1033,22 @@ class StackableFeet(StackableBaseEdge): def _height(self): return self.settings.height +class StackableHoleEdgeTop(StackableBaseEdge): + char = "Š" + description = "Stackable edge with finger holes (top)" + bottom = False + + def startwidth(self): + return self.settings.thickness + self.settings.holedistance + + def __call__(self, length, **kw): + s = self.settings + self.boxes.fingerHolesAt( + 0, + s.holedistance + 0.5 * self.boxes.thickness, + length, 0) + super().__call__(length, **kw) + ############################################################################# #### Hinges #############################################################################