2016-07-11 23:01:57 +02:00
|
|
|
#!/usr/bin/env python3
|
2014-04-06 17:05:41 +02: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/>.
|
|
|
|
|
|
|
|
from boxes import *
|
|
|
|
|
2016-08-17 15:07:41 +02:00
|
|
|
|
2014-04-06 17:05:41 +02:00
|
|
|
class TrayInsert(Boxes):
|
2016-03-15 21:29:03 +01:00
|
|
|
"""Tray insert without floor and outer walls - allows only continuous walls"""
|
2016-08-17 15:07:41 +02:00
|
|
|
|
2017-02-13 17:31:58 +01:00
|
|
|
ui_group = "Tray"
|
|
|
|
|
2023-01-08 19:41:02 +01:00
|
|
|
def __init__(self) -> None:
|
2016-03-03 13:27:22 +01:00
|
|
|
Boxes.__init__(self)
|
2016-07-09 22:52:48 +02:00
|
|
|
self.buildArgParser("sx", "sy", "h", "outside")
|
2014-04-06 17:05:41 +02:00
|
|
|
|
|
|
|
def render(self):
|
2016-08-17 15:07:41 +02:00
|
|
|
|
2016-07-09 22:52:48 +02:00
|
|
|
if self.outside:
|
|
|
|
self.sx = self.adjustSize(self.sx, False, False)
|
|
|
|
self.sy = self.adjustSize(self.sy, False, False)
|
|
|
|
|
2016-08-17 15:07:41 +02:00
|
|
|
x = sum(self.sx) + self.thickness * (len(self.sx) - 1)
|
|
|
|
y = sum(self.sy) + self.thickness * (len(self.sy) - 1)
|
2014-04-06 17:05:41 +02:00
|
|
|
h = self.h
|
|
|
|
t = self.thickness
|
|
|
|
|
|
|
|
|
|
|
|
# Inner walls
|
2016-08-17 15:07:41 +02:00
|
|
|
for i in range(len(self.sx) - 1):
|
|
|
|
e = [edges.SlottedEdge(self, self.sy, slots=0.5 * h), "e", "e", "e"]
|
|
|
|
self.rectangularWall(y, h, e, move="up")
|
|
|
|
|
|
|
|
for i in range(len(self.sy) - 1):
|
|
|
|
e = ["e", "e", edges.SlottedEdge(self, self.sx[::-1], "e", slots=0.5 * h), "e"]
|
|
|
|
self.rectangularWall(x, h, e, move="up")
|
|
|
|
|
2014-04-06 17:05:41 +02:00
|
|
|
|
2016-08-17 15:07:41 +02:00
|
|
|
|