From f83ca31a0ac6a6e053872189b2157c050b5ad61e Mon Sep 17 00:00:00 2001 From: Florian Festi Date: Mon, 6 Aug 2018 19:08:14 +0200 Subject: [PATCH] RoundedBox: Add wallpieces param --- boxes/generators/roundedbox.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/boxes/generators/roundedbox.py b/boxes/generators/roundedbox.py index 4134767..d0206ee 100644 --- a/boxes/generators/roundedbox.py +++ b/boxes/generators/roundedbox.py @@ -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()