2016-07-11 23:01:57 +02:00
|
|
|
#!/usr/bin/env python3
|
2014-03-16 18:26:12 +01:00
|
|
|
# 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/>.
|
|
|
|
|
2013-07-20 13:10:51 +02:00
|
|
|
from boxes import *
|
|
|
|
|
|
|
|
class Castle(Boxes):
|
|
|
|
|
2016-07-31 16:36:33 +02:00
|
|
|
webinterface = False
|
|
|
|
|
2013-07-20 13:10:51 +02:00
|
|
|
def __init__(self):
|
2016-03-03 13:27:22 +01:00
|
|
|
Boxes.__init__(self)
|
|
|
|
|
|
|
|
def render(self, t_x=70, t_h=250, w1_x=300, w1_h=120, w2_x=100, w2_h=120):
|
2016-06-07 20:20:35 +02:00
|
|
|
self.open()
|
2016-03-25 14:02:52 +01:00
|
|
|
s = edges.FingerJointSettings(self.thickness, relative=False,
|
|
|
|
space = 10, finger=10, height=10,
|
|
|
|
width=self.thickness)
|
|
|
|
p = edges.FingerJointEdge(self, s)
|
2013-07-20 13:10:51 +02:00
|
|
|
p.char = "p"
|
|
|
|
self.addPart(p)
|
2016-03-25 14:02:52 +01:00
|
|
|
P = edges.FingerJointEdgeCounterPart(self, s)
|
2013-07-20 13:10:51 +02:00
|
|
|
P.char = "P"
|
|
|
|
self.addPart(P)
|
|
|
|
|
|
|
|
self.moveTo(0,0)
|
2013-07-20 19:24:16 +02:00
|
|
|
self.rectangularWall(t_x, t_h, edges="efPf", move="right", callback=
|
2013-07-20 13:10:51 +02:00
|
|
|
[lambda: self.fingerHolesAt(t_x*0.5, 0, w1_h, 90),])
|
|
|
|
self.rectangularWall(t_x, t_h, edges="efPf", move="right")
|
2013-07-20 19:24:16 +02:00
|
|
|
self.rectangularWall(t_x, t_h, edges="eFPF", move="right", callback=
|
2013-07-20 13:10:51 +02:00
|
|
|
[lambda: self.fingerHolesAt(t_x*0.5, 0, w2_h, 90),])
|
|
|
|
self.rectangularWall(t_x, t_h, edges="eFPF", move="right")
|
|
|
|
|
|
|
|
self.rectangularWall(w1_x, w1_h, "efpe", move="right")
|
|
|
|
self.rectangularWall(w2_x, w2_h, "efpe", move="right")
|
|
|
|
|
2014-03-21 21:08:54 +01:00
|
|
|
self.close()
|
2013-07-20 13:10:51 +02:00
|
|
|
|
2016-03-23 22:05:06 +01:00
|
|
|
def main():
|
2016-03-03 13:27:22 +01:00
|
|
|
c = Castle()
|
|
|
|
c.parseArgs()
|
|
|
|
c.render()
|
2016-03-23 22:05:06 +01:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|