From f058ce68fb9475ae759c89818273c77394f25a0c Mon Sep 17 00:00:00 2001 From: Marcin Zukowski Date: Wed, 26 Aug 2020 13:22:10 -0700 Subject: [PATCH] Add --lid_height in UnevenHeightBox --- boxes/generators/unevenheightbox.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/boxes/generators/unevenheightbox.py b/boxes/generators/unevenheightbox.py index d5d1614..ee6b8b6 100644 --- a/boxes/generators/unevenheightbox.py +++ b/boxes/generators/unevenheightbox.py @@ -41,6 +41,9 @@ class UnevenHeightBox(Boxes): self.argparser.add_argument( "--lid", action="store", type=boolarg, default=False, help="add a lid (works best with high corners opposing each other)") + self.argparser.add_argument( + "--lid_height", action="store", type=float, default=0, + help="additional height of the lid") def render(self): @@ -69,14 +72,14 @@ class UnevenHeightBox(Boxes): if self.lid: maxh = max(heights) - lidheights = [maxh-h for h in heights] + lidheights = [maxh-h+self.lid_height for h in heights] h0, h1, h2, h3 = lidheights lidheights += lidheights edges = ["E" if (lidheights[i] == 0.0 and lidheights[i+1] == 0.0) else "f" for i in range(4)] self.rectangularWall(x, y, edges, move="up") if self.lid: - self.moveTo(0, maxh+self.edges["F"].spacing()+self.edges[b].spacing()+3*self.spacing, 180) + self.moveTo(0, maxh+self.lid_height+self.edges["F"].spacing()+self.edges[b].spacing()+3*self.spacing, 180) self.trapezoidWall(y, h0, h3, "Ffef", move="right" + (" only" if h0 == h3 == 0.0 else "")) self.trapezoidWall(x, h3, h2, "FFeF", move="right" +