Skip to content

Commit

Permalink
UniversalBox: Fix labels and top edges
Browse files Browse the repository at this point in the history
to have x as width and y as depth and the lids fitting

Related: florianfesti#469
  • Loading branch information
florianfesti committed Apr 1, 2023
1 parent 51f42fd commit d175ced
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions boxes/generators/universalbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def render(self):
x, y, h = self.x, self.y, self.h
t = self.thickness

t1, t2, t3, t4 = self.topEdges(self.top_edge)
tl, tb, tr, tf = self.topEdges(self.top_edge)
b = self.edges.get(self.bottom_edge, self.edges["F"])

d2 = Bolts(2)
Expand All @@ -78,12 +78,12 @@ def render(self):
self.h = h = self.adjustSize(h, b, self.top_edge)

with self.saved_context():
self.rectangularWall(x, h, [b, sideedge, t1, sideedge],
self.rectangularWall(x, h, [b, sideedge, tf, sideedge],
ignore_widths=[1, 6],
bedBolts=[d2], move="up", label="left")
self.rectangularWall(x, h, [b, sideedge, t3, sideedge],
bedBolts=[d2], move="up", label="front")
self.rectangularWall(x, h, [b, sideedge, tb, sideedge],
ignore_widths=[1, 6],
bedBolts=[d2], move="up", label="right")
bedBolts=[d2], move="up", label="back")

if self.bottom_edge != "e":
self.rectangularWall(x, y, "ffff", bedBolts=[d2, d3, d2, d3], move="up", label="bottom")
Expand All @@ -95,14 +95,14 @@ def render(self):
self.drawLid(x, y, self.top_edge, [d2, d3])
self.drawAddOnLid(x, y, self.lid)

self.rectangularWall(x, h, [b, sideedge, t3, sideedge],
self.rectangularWall(x, h, [b, sideedge, tf, sideedge],
ignore_widths=[1, 6],
bedBolts=[d2], move="right only", label="invisible")
self.rectangularWall(y, h, [b, "f", t2, "f"],
self.rectangularWall(y, h, [b, "f", tl, "f"],
ignore_widths=[1, 6],
bedBolts=[d3], move="up", label="back")
self.rectangularWall(y, h, [b, "f", t4, "f"],
bedBolts=[d3], move="up", label="left")
self.rectangularWall(y, h, [b, "f", tr, "f"],
ignore_widths=[1, 6],
bedBolts=[d3], move="up", label="front")
bedBolts=[d3], move="up", label="right")


0 comments on commit d175ced

Please sign in to comment.