From 77773573fbb0148abd7834903149bc0b6658b6ac Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Tue, 29 Mar 2016 21:29:57 +0200 Subject: [PATCH] Ommit zero length sides in surroundingWall() --- boxes/__init__.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/boxes/__init__.py b/boxes/__init__.py index bb77ba1..a0f441e 100755 --- a/boxes/__init__.py +++ b/boxes/__init__.py @@ -957,11 +957,17 @@ class Boxes: self.cc(callback, 0, y=bottomwidth+self.burn) bottom(x/2.0-r) - for i, l in zip(range(4), (y, x, y, 0)): - self.flexEdge(c4, h+topwidth+bottomwidth) - self.cc(callback, i+1, y=bottomwidth+self.burn) - if i < 3: - bottom(l-2*r) + if (y-2*r) < 1E-3: + self.flexEdge(2*c4, h+topwidth+bottomwidth) + self.cc(callback, 2, y=bottomwidth+self.burn) + bottom(x-2*r) + self.flexEdge(2*c4, h+topwidth+bottomwidth) + else: + for i, l in zip(range(4), (y, x, y, 0)): + self.flexEdge(c4, h+topwidth+bottomwidth) + self.cc(callback, i+1, y=bottomwidth+self.burn) + if i < 3: + bottom(l-2*r) bottom(x/2.0-r) self.corner(90)