RoundedBox: Add wallpieces param

This commit is contained in:
Florian Festi 2018-08-06 19:08:14 +02:00
parent af7f29c51f
commit f83ca31a0a
1 changed files with 8 additions and 6 deletions

View File

@ -29,6 +29,9 @@ class RoundedBox(Boxes):
self.argparser.add_argument(
"--radius", action="store", type=float, default=15,
help="Radius of the corners in mm")
self.argparser.add_argument(
"--wallpieces", action="store", type=int, default=1,
choices=[1, 2, 3, 4], help="# pieces of outer wall")
self.argparser.add_argument(
"--top", action="store", type=str, default="none",
choices=["closed", "hole", "lid",],
@ -69,16 +72,15 @@ class RoundedBox(Boxes):
t = self.thickness
self.ctx.save()
self.roundedPlate(x, y, r, move="right")
self.roundedPlate(x, y, r, move="right",
self.roundedPlate(x, y, r, wallpieces=self.wallpieces, move="right")
self.roundedPlate(x, y, r, wallpieces=self.wallpieces, move="right",
callback=[self.hole] if self.top != "closed" else None)
if self.top == "lid":
self.roundedPlate(x, y, r, "E", move="right")
self.roundedPlate(x, y, r, "E", wallpieces=self.wallpieces, move="right")
self.ctx.restore()
self.roundedPlate(x, y, r, move="up only")
self.surroundingWall(x, y, r, h, "F", "F")
self.roundedPlate(x, y, r, wallpieces=self.wallpieces, move="up only")
self.surroundingWall(x, y, r, h, "F", "F", pieces=self.wallpieces)
self.close()