From 4a5aee7ad785e39b32075643ae184e0470c0de88 Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Tue, 19 Jul 2022 09:27:17 +0200 Subject: [PATCH] BirdHouse: Fix the gable walls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Looks like edgeCorner() still doesn't work properly with angles < 90°. Avoid issue by switching to f edges that don't need width adjustments. Also make the roof wider Related: #414 --- boxes/generators/birdhouse.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/boxes/generators/birdhouse.py b/boxes/generators/birdhouse.py index b0357f2..45f9c2c 100644 --- a/boxes/generators/birdhouse.py +++ b/boxes/generators/birdhouse.py @@ -29,7 +29,7 @@ class BirdHouse(Boxes): # remove cli params you do not need self.buildArgParser(x=200, y=200, h=200) - def side(self, x, h, edges="hFeffeF", callback=None, move=None): + def side(self, x, h, edges="hfeffef", callback=None, move=None): angles = (90, 0, 45, 90, 45, 0, 90) roof = 2**0.5 * x / 2 t = self.thickness @@ -38,12 +38,13 @@ class BirdHouse(Boxes): edges = [self.edges.get(e, e) for e in edges] edges.append(edges[0]) # wrap arround - tw = x + edges[1].spacing() - th = h + roof + max(edges[2].spacing(), edges[2].spacing()) + tw = x + edges[1].spacing() + edges[-2].spacing() + th = h + x/2 + t + edges[0].spacing() + max(edges[3].spacing(), edges[4].spacing()) if self.move(tw, th, move, True): return - + + self.moveTo(edges[-2].spacing()) for i in range(7): self.cc(callback, i, y=self.burn+edges[i].startwidth()) edges[i](lengths[i]) @@ -66,8 +67,9 @@ class BirdHouse(Boxes): self.side(x, h, callback=cbx, move="right") self.side(x, h, callback=cbx, move="right") - self.rectangularWall(y, h, "hfef", callback=cby, move="right") - self.rectangularWall(y, h, "hfef", callback=cby, move="right") + self.rectangularWall(y, h, "hFeF", callback=cby, move="right") + self.rectangularWall(y, h, "hFeF", callback=cby, move="right") self.rectangularWall(x, y, "ffff", move="right") + self.edges["h"].settings.setValues(self.thickness, relative=False, edge_width=0.1*roof) self.flangedWall(y, roof, "ehfh", r=0.2*roof, flanges=[0.2*roof], move="right") self.flangedWall(y, roof, "ehFh", r=0.2*roof, flanges=[0.2*roof], move="right")