Add FlexTest2 for new 2D flex pattern

This commit is contained in:
Florian Festi 2016-07-12 16:48:53 +02:00
parent f33f74ab3f
commit 33a1333ad9
3 changed files with 45 additions and 1 deletions

View File

@ -10,6 +10,7 @@ __all__ = [
"flexbox3", "flexbox3",
"flexbox4", "flexbox4",
"flextest", "flextest",
"flextest2",
"folder", "folder",
"lamp", "lamp",
"magazinefile", "magazinefile",

View File

@ -0,0 +1,42 @@
#!/usr/bin/python3
# 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 <http://www.gnu.org/licenses/>.
from boxes import *
class FlexTest(Boxes):
"Piece for testing different flex settings"
def __init__(self):
Boxes.__init__(self)
self.buildArgParser("x", "y")
self.argparser.add_argument(
"--fw", action="store", type=float, default=1,
help="distance of flex cuts in multiples of thickness")
def render(self):
x, y = self.x, self.y
t = self.thickness
self.open()
self.moveTo(t, t)
self.rectangularWall(x, y, callback=[lambda:self.flex2D(x, y, self.fw)])
self.close()
def main():
f = FlexTest()
f.parseArgs()
f.render()
if __name__ == '__main__':
main()

View File

@ -28,7 +28,7 @@ except ImportError:
from boxes.generators import box, box2, box3, drillbox from boxes.generators import box, box2, box3, drillbox
from boxes.generators import flexbox, flexbox2, flexbox3, flexbox4 from boxes.generators import flexbox, flexbox2, flexbox3, flexbox4
from boxes.generators import flextest, folder from boxes.generators import flextest, flextest2, folder
from boxes.generators import magazinefile, trayinsert, traylayout, typetray, silverwarebox from boxes.generators import magazinefile, trayinsert, traylayout, typetray, silverwarebox
@ -86,6 +86,7 @@ class BServer:
"FlexBox3" : flexbox3.FlexBox(), "FlexBox3" : flexbox3.FlexBox(),
"FlexBox4" : flexbox4.FlexBox(), "FlexBox4" : flexbox4.FlexBox(),
"FlexTest": flextest.FlexTest(), "FlexTest": flextest.FlexTest(),
"FlexTest2": flextest2.FlexTest(),
"Folder": folder.Folder(), "Folder": folder.Folder(),
"MagazinFile" : magazinefile.Box(), "MagazinFile" : magazinefile.Box(),
"TrayInsert" : trayinsert.TrayInsert(), "TrayInsert" : trayinsert.TrayInsert(),