Rotary: Add knifethickness param and support variant for honey comb table

This commit is contained in:
Florian Festi 2016-08-05 21:53:35 +02:00
parent 072845be57
commit 828cd12d49
1 changed files with 25 additions and 16 deletions

View File

@ -38,13 +38,14 @@ class HangerEdge(edges.BaseEdge):
def __call__(self, l, **kw): def __call__(self, l, **kw):
self.fingerHolesAt(0, -0.5*self.thickness, l, angle=0) self.fingerHolesAt(0, -0.5*self.thickness, l, angle=0)
w = self.settings
self.polyline(0, -90, self.polyline(0, -90,
30, 90, 22+w, 90,
70, 135, 70, 135,
2**0.5*12, 45, 2**0.5*12, 45,
35, -45, 35, -45,
2**0.5*4, -90, 2**0.5*0.5*w, -90,
2**0.5*4, -45, 2**0.5*0.5*w, -45,
l -28, 45, l -28, 45,
2**0.5*5, 45, 5, -90) 2**0.5*5, 45, 5, -90)
@ -86,6 +87,10 @@ class Rotary(Boxes):
self.argparser.add_argument( self.argparser.add_argument(
"--axle", action="store", type=float, default=6., "--axle", action="store", type=float, default=6.,
help="diameter of the axles") help="diameter of the axles")
self.argparser.add_argument(
"--knifethickness", action="store", type=float, default=8.,
help="thickness of the knifes in mm. Use 0 for use with honey comb table.")
def mainPlate(self): def mainPlate(self):
@ -166,7 +171,10 @@ class Rotary(Boxes):
# Change settings of default edges if needed. E.g.: # Change settings of default edges if needed. E.g.:
self.edges["f"].settings.setValues(self.thickness, space=2, finger=2, self.edges["f"].settings.setValues(self.thickness, space=2, finger=2,
surroundingspaces=1) surroundingspaces=1)
self.addPart(HangerEdge(self, None)) if self.knifethickness:
self.addPart(HangerEdge(self, self.knifethickness))
else:
self.edges["H"] = self.edges["F"]
# render your parts here # render your parts here
self.moveTo(5*t, 5*t) self.moveTo(5*t, 5*t)
# Holder # Holder
@ -241,18 +249,19 @@ class Rotary(Boxes):
self.ctx.restore() self.ctx.restore()
self.rectangularWall(30, 30, move="up only") self.rectangularWall(30, 30, move="up only")
# Other side # Other side
ow = 10 if self.knifethickness:
self.rectangularWall(3.6*d, 1.1*d, edges="hfFf", callback=[ ow = 10
lambda:self.rectangularHole(1.8*d, 3.6, 32, 7.1)], move="up") self.rectangularWall(3.6*d, 1.1*d, edges="hfFf", callback=[
self.rectangularWall(3.6*d, 1.1*d, edges="hfFf", callback=[ lambda:self.rectangularHole(1.8*d, 3.6, 32, 7.1)], move="up")
lambda:self.rectangularHole(1.8*d, 3.6, 32, 7.1)], move="up") self.rectangularWall(3.6*d, 1.1*d, edges="hfFf", callback=[
self.rectangularWall(3.6*d, ow, edges="ffff", move="up") lambda:self.rectangularHole(1.8*d, 3.6, 32, 7.1)], move="up")
self.rectangularWall(3.6*d, ow, edges="ffff", move="up") self.rectangularWall(3.6*d, ow, edges="ffff", move="up")
self.ctx.save() self.rectangularWall(3.6*d, ow, edges="ffff", move="up")
self.rectangularWall(ow, 1.1*d, edges="hFFH", move="right") self.ctx.save()
self.rectangularWall(ow, 1.1*d, edges="hFFH", move="right") self.rectangularWall(ow, 1.1*d, edges="hFFH", move="right")
self.ctx.restore() self.rectangularWall(ow, 1.1*d, edges="hFFH", move="right")
self.rectangularWall(ow, 1.1*d, edges="hFFH", move="up only") self.ctx.restore()
self.rectangularWall(ow, 1.1*d, edges="hFFH", move="up only")
# Motor block # Motor block
mw = 40 mw = 40