Skip to content

Commit

Permalink
FlexBox4: Make latchsize configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
florianfesti committed Oct 19, 2018
1 parent 4ba18d8 commit a900973
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion boxes/generators/flexbox4.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ def __init__(self):
self.argparser.add_argument(
"--radius", action="store", type=float, default=15,
help="Radius of the corners in mm")
self.argparser.add_argument(
"--latchsize", action="store", type=float, default=8,
help="size of latch in multiples of thickness")

def flexBoxSide(self, x, y, r, callback=None, move=None):
t = self.thickness
Expand Down Expand Up @@ -102,7 +105,7 @@ def render(self):
self.y = self.adjustSize(self.y)
self.h = self.adjustSize(self.h)

self.latchsize = 8 * self.thickness
self.latchsize *= self.thickness
self.radius = self.radius or min(self.x / 2.0, self.y - self.latchsize)
self.radius = min(self.radius, self.x / 2.0)
self.radius = min(self.radius, max(0, self.y - self.latchsize))
Expand Down

0 comments on commit a900973

Please sign in to comment.