From e2b87af2a4b91a223087b80da06f7c845a8d6901 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Sat, 14 Dec 2019 19:00:32 +0100 Subject: [PATCH] UniversalBox: Add outside parameter Fixes: #144 --- boxes/generators/universalbox.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/boxes/generators/universalbox.py b/boxes/generators/universalbox.py index c8b3aa3..fe5c3cd 100644 --- a/boxes/generators/universalbox.py +++ b/boxes/generators/universalbox.py @@ -27,7 +27,8 @@ class UniversalBox(_TopEdge, _ChestLid): Boxes.__init__(self) self.addTopEdgeSettings(roundedtriangle={"outset" : 1}) self.addSettingsArgs(edges.FlexSettings) - self.buildArgParser("top_edge", "bottom_edge", "x", "y", "h") + self.buildArgParser("top_edge", "bottom_edge", + "x", "y", "h", "outside") self.argparser.add_argument( "--lid", action="store", type=str, default="default (none)", choices=("default (none)", "chest", "flat"), @@ -56,7 +57,6 @@ class UniversalBox(_TopEdge, _ChestLid): x, y, h = self.x, self.y, self.h t = self.thickness - t1, t2, t3, t4 = self.topEdges(self.top_edge) b = self.edges.get(self.bottom_edge, self.edges["F"]) @@ -65,6 +65,10 @@ class UniversalBox(_TopEdge, _ChestLid): d2 = d3 = None + if self.outside: + self.x = x = self.adjustSize(x) + self.y = y = self.adjustSize(y) + self.h = h = self.adjustSize(h, b, self.top_edge) with self.saved_context(): self.rectangularWall(x, h, [b, "F", t1, "F"],