Skip to content

Commit

Permalink
closedbox: Add option to enable bed bolts
Browse files Browse the repository at this point in the history
  • Loading branch information
chrysn committed Feb 10, 2024
1 parent 0fa97e2 commit 1288b44
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions boxes/generators/closedbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,13 @@ class ClosedBox(Boxes):
def __init__(self) -> None:
Boxes.__init__(self)
self.addSettingsArgs(edges.FingerJointSettings)
self.addSettingsArgs(edges.BedBoltSettings)
self.buildArgParser("x", "y", "h", "outside")

self.argparser.add_argument(
"--bedbolts", action="store", type=boolarg, default=False,
help="Use bed bolts")

def render(self):

x, y, h = self.x, self.y, self.h
Expand All @@ -43,10 +48,11 @@ def render(self):

t = self.thickness

d2 = edges.Bolts(2)
d3 = edges.Bolts(3)

d2 = d3 = None
if self.bedbolts:
d2 = edges.Bolts(2)
d3 = edges.Bolts(3)
else:
d2 = d3 = None

self.rectangularWall(x, h, "FFFF", bedBolts=[d2] * 4, move="right", label="Wall 1")
self.rectangularWall(y, h, "FfFf", bedBolts=[d3, d2, d3, d2], move="up", label="Wall 2")
Expand Down

0 comments on commit 1288b44

Please sign in to comment.