2018-11-05 21:37:51 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# Copyright (C) 2013-2018 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 AllEdges(Boxes):
|
|
|
|
"""Showing all edge types"""
|
|
|
|
|
|
|
|
ui_group = "Misc"
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
Boxes.__init__(self)
|
|
|
|
|
|
|
|
self.addSettingsArgs(edges.FingerJointSettings)
|
|
|
|
self.addSettingsArgs(edges.StackableSettings)
|
|
|
|
self.addSettingsArgs(edges.HingeSettings)
|
|
|
|
self.addSettingsArgs(edges.LidSettings)
|
|
|
|
self.addSettingsArgs(edges.ClickSettings)
|
|
|
|
self.addSettingsArgs(edges.FlexSettings)
|
2022-06-16 14:59:36 +02:00
|
|
|
self.addSettingsArgs(edges.HandleEdgeSettings)
|
2018-11-05 21:37:51 +01:00
|
|
|
|
|
|
|
self.buildArgParser(x=100)
|
|
|
|
|
|
|
|
def render(self):
|
|
|
|
x = self.x
|
|
|
|
t = self.thickness
|
|
|
|
|
|
|
|
chars = list(self.edges.keys())
|
|
|
|
chars.sort(key=lambda c: c.lower() + (c if c.isupper() else ''))
|
|
|
|
chars.reverse()
|
2019-04-09 21:51:21 +02:00
|
|
|
|
|
|
|
self.moveTo(0, 10*t)
|
2018-11-05 21:37:51 +01:00
|
|
|
|
|
|
|
for c in chars:
|
2019-01-12 23:16:11 +01:00
|
|
|
with self.saved_context():
|
2020-11-09 19:12:02 +01:00
|
|
|
self.move(0, 0, "", True)
|
2019-04-09 21:51:21 +02:00
|
|
|
self.moveTo(x, 0, 90)
|
|
|
|
self.edge(t+self.edges[c].startwidth())
|
|
|
|
self.corner(90)
|
2019-01-12 23:16:11 +01:00
|
|
|
self.edges[c](x, h=4*t)
|
2019-04-09 21:51:21 +02:00
|
|
|
self.corner(90)
|
|
|
|
self.edge(t+self.edges[c].endwidth())
|
2020-11-09 19:12:02 +01:00
|
|
|
self.move(0, 0, "")
|
2019-04-09 21:51:21 +02:00
|
|
|
|
|
|
|
self.moveTo(0, 3*t + self.edges[c].spacing())
|
|
|
|
self.text("%s - %s" % (c, self.edges[c].description))
|
|
|
|
self.moveTo(0, 12*t)
|
2018-11-05 21:37:51 +01:00
|
|
|
|