UnevenHeightBox: Fix lid

Looks like it is difficult to come up with a really non symmectrical test case.
Thanks to Mekol for pointing this out!

Related #60
This commit is contained in:
Florian Festi 2018-03-17 21:04:24 +01:00
parent fa44eb27cf
commit b2c54310b6
1 changed files with 10 additions and 10 deletions

View File

@ -83,7 +83,7 @@ class UnevenHeightBox(Boxes):
heights[i] = self.adjustSize(heights[i], None)
t = self.thickness
h0 , h1, h2 , h3 = heights
h0, h1, h2, h3 = heights
b = self.bottom_edge
self.wall(x, h0, h1, [b, "F", "F"], move="right")
@ -97,7 +97,7 @@ class UnevenHeightBox(Boxes):
if self.lid:
maxh = max(heights)
lidheights = [maxh-h for h in heights]
h0 , h1, h2 , h3 = lidheights
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)]
@ -106,14 +106,14 @@ class UnevenHeightBox(Boxes):
self.ctx.restore()
self.moveTo(0, maxh+self.edges["F"].spacing()+self.edges[b].spacing()+3*self.spacing, 180)
self.wall(y, h0, h1, "Fff", move="right" +
(" only" if h0 == h1 == 0.0 else ""))
self.wall(x, h1, h2, "FFF", move="right" +
(" only" if h1 == h2 == 0.0 else ""))
self.wall(y, h2, h3, "Fff", move="right" +
(" only" if h2 == h3 == 0.0 else ""))
self.wall(x, h3, h0, "FFF", move="right" +
(" only" if h3 == h0 == 0.0 else ""))
self.wall(y, h0, h3, "Fff", move="right" +
(" only" if h0 == h3 == 0.0 else ""))
self.wall(x, h3, h2, "FFF", move="right" +
(" only" if h3 == h2 == 0.0 else ""))
self.wall(y, h2, h1, "Fff", move="right" +
(" only" if h2 == h1 == 0.0 else ""))
self.wall(x, h1, h0, "FFF", move="right" +
(" only" if h1 == h0 == 0.0 else ""))
self.close()