Add e edge to bottom_edge selection

This commit is contained in:
Florian Festi 2018-12-08 18:21:36 +01:00
parent fd956d1f08
commit 4d2592fecf
4 changed files with 18 additions and 10 deletions

View File

@ -334,7 +334,7 @@ class Boxes:
if default is None: default = "h"
self.argparser.add_argument(
"--bottom_edge", action="store",
type=ArgparseEdgeType("Fhs"), choices=list("Fhs"),
type=ArgparseEdgeType("Fhse"), choices=list("Fhse"),
default=default,
help="edge type for bottom edge")
elif arg == "top_edge":

View File

@ -105,8 +105,9 @@ class TypeTray(Boxes):
self.rectangularWall(x, h, e1, callback=[self.xHoles, ], move="left up")
# floor
self.rectangularWall(x, y, "ffff", callback=[
self.xSlots, self.ySlots],move="right")
if b != "e":
self.rectangularWall(x, y, "ffff", callback=[
self.xSlots, self.ySlots], move="right")
if self.closedtop:
if sameh:
self.rectangularWall(x, y, "ffff", callback=[
@ -115,19 +116,22 @@ class TypeTray(Boxes):
self.rectangularWall(x, y, "ffff", move="right")
# Inner walls
be = "f" if b != "e" else "e"
for i in range(len(self.sx) - 1):
e = [edges.SlottedEdge(self, self.sy, "f", slots=0.5 * hi),
e = [edges.SlottedEdge(self, self.sy, be, slots=0.5 * hi),
"f", "e", "f"]
if self.closedtop and sameh:
e = [edges.SlottedEdge(self, self.sy, "f", slots=0.5 * hi),"f",
e = [edges.SlottedEdge(self, self.sy, be, slots=0.5 * hi),"f",
edges.SlottedEdge(self, self.sy[::-1], "f"), "f"]
self.rectangularWall(y, hi, e, move="up")
for i in range(len(self.sy) - 1):
e = [edges.SlottedEdge(self, self.sx, "f"), "f",
e = [edges.SlottedEdge(self, self.sx, be), "f",
edges.SlottedEdge(self, self.sx[::-1], "e", slots=0.5 * hi), "f"]
if self.closedtop and sameh:
e = [edges.SlottedEdge(self, self.sx, "f"), "f",
e = [edges.SlottedEdge(self, self.sx, be), "f",
edges.SlottedEdge(self, self.sx[::-1], "f", slots=0.5 * hi), "f"]
self.rectangularWall(x, hi, e, move="up")

View File

@ -92,7 +92,9 @@ class UnevenHeightBox(Boxes):
self.wall(y, h3, h0, [b, "f", "f"], move="right")
self.ctx.save()
self.rectangularWall(x, y, "ffff", move="up")
if b != "e":
self.rectangularWall(x, y, "ffff", move="up")
if self.lid:
maxh = max(heights)

View File

@ -77,8 +77,10 @@ class UniversalBox(_TopEdge, _ChestLid):
self.rectangularWall(x, h, [b, "F", t3, "F"],
bedBolts=[d2], move="up only")
self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="right")
if self.drawLid(x, y, self.top_edge, [d2, d3]):
if self.bottom_edge != "e":
self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="right")
if (self.drawLid(x, y, self.top_edge, [d2, d3]) and
self.bottom_edge != "e"):
self.rectangularWall(x, y, "ffff", move="left only")
if self.top_edge in "fF":
self.ctx.set_source_rgb(1., 0, 0)