Skip to content

Commit

Permalink
DiceTower: Make bottom piece optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tljuniper authored and florianfesti committed Sep 10, 2024
1 parent b24312b commit 10a152b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions boxes/generators/dicetower.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ def __init__(self):
self.argparser.add_argument(
"--height", action="store", type=float, default=170.0, help="height of the tower")
self.buildArgParser("outside")
self.argparser.add_argument(
"--bottom", action="store", type=boolarg, default=True, help="include bottom piece")
self.argparser.add_argument(
"--ramps", action="store", type=int, default=3, help="number of ramps in the tower")
self.argparser.add_argument(
Expand Down Expand Up @@ -87,13 +89,15 @@ def render(self):
front_edge = edges.CompoundEdge(self, "Ef", (front_gap, self.height - front_gap))

# Outer walls
self.rectangularWall(self.depth, self.height, ("F", front_edge, "e", "f"), callback=[self.side], move="mirror right", label="side")
self.rectangularWall(self.width, self.height, "FFeF", move="right", label="back")
self.rectangularWall(self.depth, self.height, ("F", front_edge, "e", "f"), callback=[self.side], move="right", label="side")
self.rectangularWall(self.width, self.height - front_gap, "eFeF", move="right", label="front")
bottom_edge = "F" if self.bottom else "e"
self.rectangularWall(self.depth, self.height, (bottom_edge, front_edge, "e", "f"), callback=[self.side], move="mirror right", label="side")
self.rectangularWall(self.width, self.height, (bottom_edge, "F", "e", "F"), move="right", label="back")
self.rectangularWall(self.depth, self.height, (bottom_edge, front_edge, "e", "f"), callback=[self.side], move="right", label="side")
self.rectangularWall(self.width, self.height - front_gap, ("e", "F", "e", "F"), move="right", label="front")

# Bottom
self.rectangularWall(self.width, self.depth, "Efff", move="right", label="bottom")
if self.bottom:
self.rectangularWall(self.width, self.depth, "Efff", move="right", label="bottom")

# ramps
self.rectangularWall(self.width, self.ramp_len, "efef", move="up", label="ramp")
Expand Down

0 comments on commit 10a152b

Please sign in to comment.