Add params for flextest pattern

This commit is contained in:
Florian Festi 2016-03-15 21:03:05 +01:00
parent 83c76f6fc7
commit 0a4c90e113
2 changed files with 13 additions and 3 deletions

View File

@ -6,7 +6,6 @@
* Make settings nicer
* offer a collection of different settings
* Make bolts configurable (e.g. box2.py)
* Make flextest.py pattern configurable
* setup.py
* Use other formatter (see mx param)
* Fix error message on parsing error in web interface

View File

@ -17,16 +17,27 @@
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(
"--fd", action="store", type=float, default=0.5,
help="distance of flex cuts in multiples of thickness")
self.argparser.add_argument(
"--fc", action="store", type=float, default=1.0,
help="connections of flex cuts in multiples of thickness")
self.argparser.add_argument(
"--fw", action="store", type=float, default=5.0,
help="width of flex cuts in multiples of thickness")
def render(self):
x, y = self.x, self.y
self.open(x+60, y+20)
# (1.5, 3.0, 15.0) # line distance, connects, width
self.flexSettings = (2, 4.0, 16.0)
self.edges["X"].settings.setValues(
self.thickness, relative=True,
distance=self.fd, connection=self.fc, width=self.fw)
self.moveTo(5, 5)
self.edge(10)