2016-07-11 23:01:57 +02:00
|
|
|
#!/usr/bin/env python3
|
2016-03-29 22:10:54 +02:00
|
|
|
# Copyright (C) 2013-2016 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 *
|
|
|
|
|
2017-05-20 20:40:48 +02:00
|
|
|
class BOX(Boxes): # Change class name!
|
2016-03-29 22:10:54 +02:00
|
|
|
"""DESCRIPTION"""
|
2017-11-03 22:06:14 +01:00
|
|
|
|
2017-05-20 20:40:48 +02:00
|
|
|
ui_group = "Unstable" # see ./__init__.py for names
|
|
|
|
|
2016-03-29 22:10:54 +02:00
|
|
|
def __init__(self):
|
|
|
|
Boxes.__init__(self)
|
2016-11-01 14:03:07 +01:00
|
|
|
|
|
|
|
# Uncomment the settings for the edge types you use
|
2017-09-16 21:30:23 +02:00
|
|
|
# use keyword args to set default values
|
|
|
|
# self.addSettingsArgs(edges.FingerJointSettings, finger=1.0,space=1.0)
|
2016-11-01 14:03:07 +01:00
|
|
|
# self.addSettingsArgs(edges.StackableSettings)
|
|
|
|
# self.addSettingsArgs(edges.HingeSettings)
|
|
|
|
# self.addSettingsArgs(edges.LidSettings)
|
|
|
|
# self.addSettingsArgs(edges.ClickSettings)
|
|
|
|
# self.addSettingsArgs(edges.FlexSettings)
|
|
|
|
|
2016-03-29 22:10:54 +02:00
|
|
|
# remove cli params you do not need
|
2017-09-16 21:30:23 +02:00
|
|
|
self.buildArgParser(x=100, sx="3*50", y=100, sy="3*50", h=100, hi=0)
|
2016-03-29 22:10:54 +02:00
|
|
|
# Add non default cli params if needed (see argparse std lib)
|
|
|
|
self.argparser.add_argument(
|
|
|
|
"--XX", action="store", type=float, default=0.5,
|
|
|
|
help="DESCRIPTION")
|
2017-11-03 22:06:14 +01:00
|
|
|
|
2016-03-29 22:10:54 +02:00
|
|
|
|
|
|
|
def render(self):
|
|
|
|
# adjust to the variables you want in the local scope
|
|
|
|
x, y, h = self.x, self.y, self.h
|
|
|
|
t = self.thickness
|
|
|
|
|
|
|
|
# Create new Edges here if needed E.g.:
|
|
|
|
s = edges.FingerJointSettings(self.thickness, relative=False,
|
2017-11-03 22:06:14 +01:00
|
|
|
space = 10, finger=10,
|
2016-03-29 22:10:54 +02:00
|
|
|
width=self.thickness)
|
|
|
|
p = edges.FingerJointEdge(self, s)
|
2022-04-02 09:52:34 +02:00
|
|
|
p.char = "a" # 'a', 'A', 'b' and 'B' is reserved for beeing used within generators
|
2016-03-29 22:10:54 +02:00
|
|
|
self.addPart(p)
|
|
|
|
|
|
|
|
# render your parts here
|
|
|
|
|