From 6c552613cb4bc737e4e8ee8f1f13b3cd20c76846 Mon Sep 17 00:00:00 2001 From: Jason Dunsmore <53437+jasondunsmore@users.noreply.github.com> Date: Fri, 13 Dec 2024 14:25:00 -0600 Subject: [PATCH] Add generator for Z-Beam or U-Beam Can be a Z-Beam or a U-Beam depending on the orientation of the pieces. With the --flanged_ubeam option, a 4th piece is added for a flange. --- boxes/generators/zbeam.py | 50 +++++++++++++++++++++++++++++++++++++++ examples/ZBeam.svg | 45 +++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 boxes/generators/zbeam.py create mode 100644 examples/ZBeam.svg diff --git a/boxes/generators/zbeam.py b/boxes/generators/zbeam.py new file mode 100644 index 00000000..b7181835 --- /dev/null +++ b/boxes/generators/zbeam.py @@ -0,0 +1,50 @@ +# Copyright (C) 2013-2014 Florian Festi +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +from boxes import * + + +class ZBeam(Boxes): + """Simple Z-Beam (or U-Beam): three pieces joined at right angles""" + + ui_group = "Part" + + def __init__(self) -> None: + Boxes.__init__(self) + self.buildArgParser("x", "y") + self.argparser.add_argument( + "--z", action="store", type=float, default=100.0) + self.argparser.add_argument( + "--flanged_ubeam", action="store", type=boolarg, default=False, + help="Add a fourth piece to make a U-Beam with a flange") + self.buildArgParser("h", "outside") + self.addSettingsArgs(edges.FingerJointSettings) + + def render(self): + x, y, z, h = self.x, self.y, self.z, self.h + t = self.thickness + + if self.outside: + x = self.adjustSize(x, False) + y = self.adjustSize(y, False) + z = self.adjustSize(z, False) + + self.rectangularWall(x, h, "eFee", move="right") + self.rectangularWall(y, h, "efef", move="right") + if self.flanged_ubeam: + self.rectangularWall(y, h, "eFeF", move="right") + self.rectangularWall(z + self.thickness, h, "eeef") + else: + self.rectangularWall(z, h, "eeeF") diff --git a/examples/ZBeam.svg b/examples/ZBeam.svg new file mode 100644 index 00000000..47d28abf --- /dev/null +++ b/examples/ZBeam.svg @@ -0,0 +1,45 @@ + + + +ZBeam + + +Part - ZBeam +2024-12-13 18:22:54 +http://192.168.0.174:8000/ZBeam?FingerJoint_style=rectangular&FingerJoint_surroundingspaces=2.0&FingerJoint_bottom_lip=0.0&FingerJoint_edge_width=1.0&FingerJoint_extra_length=0.0&FingerJoint_finger=2.0&FingerJoint_play=0.0&FingerJoint_space=2.0&FingerJoint_width=1.0&x=100.0&y=100.0&z=100.0&flanged_ubeam=0&h=100.0&outside=0&outside=1&thickness=3.0&format=svg&tabs=0.0&qr_code=0&debug=0&labels=0&labels=1&reference=100.0&inner_corners=loop&burn=0.1&language=en&render=2 +http://192.168.0.174:8000/ZBeam +Simple Z-Beam (or U-Beam): three pieces joined at right angles + +Created with Boxes.py (https://boxes.hackerspace-bamberg.de/) +Command line: boxes ZBeam --FingerJoint_style=rectangular --FingerJoint_surroundingspaces=2.0 --FingerJoint_bottom_lip=0.0 --FingerJoint_edge_width=1.0 --FingerJoint_extra_length=0.0 --FingerJoint_finger=2.0 --FingerJoint_play=0.0 --FingerJoint_space=2.0 --FingerJoint_width=1.0 --x=100.0 --y=100.0 --z=100.0 --flanged_ubeam=0 --h=100.0 --outside=0 --outside=1 --thickness=3.0 --format=svg --tabs=0.0 --qr_code=0 --debug=0 --labels=0 --labels=1 --reference=100.0 --inner_corners=loop --burn=0.1 +Command line short: boxes ZBeam +Url: http://192.168.0.174:8000/ZBeam?FingerJoint_style=rectangular&FingerJoint_surroundingspaces=2.0&FingerJoint_bottom_lip=0.0&FingerJoint_edge_width=1.0&FingerJoint_extra_length=0.0&FingerJoint_finger=2.0&FingerJoint_play=0.0&FingerJoint_space=2.0&FingerJoint_width=1.0&x=100.0&y=100.0&z=100.0&flanged_ubeam=0&h=100.0&outside=0&outside=1&thickness=3.0&format=svg&tabs=0.0&qr_code=0&debug=0&labels=0&labels=1&reference=100.0&inner_corners=loop&burn=0.1&language=en&render=2 +Url short: http://192.168.0.174:8000/ZBeam +SettingsUrl: http://192.168.0.174:8000/ZBeam?FingerJoint_style=rectangular&FingerJoint_surroundingspaces=2.0&FingerJoint_bottom_lip=0.0&FingerJoint_edge_width=1.0&FingerJoint_extra_length=0.0&FingerJoint_finger=2.0&FingerJoint_play=0.0&FingerJoint_space=2.0&FingerJoint_width=1.0&x=100.0&y=100.0&z=100.0&flanged_ubeam=0&h=100.0&outside=0&outside=1&thickness=3.0&format=svg&tabs=0.0&qr_code=0&debug=0&labels=0&labels=1&reference=100.0&inner_corners=loop&burn=0.1&language=en&render=2 +SettingsUrl short: http://192.168.0.174:8000/ZBeam + + + + + 100.0mm, burn:0.10mm + + + + + + + + + + + \ No newline at end of file