DrillStand: pass edges param to sidewall

Use sidewall() in SlatwallDrillbox, too
This commit is contained in:
Florian Festi 2022-01-23 17:25:46 +01:00
parent 6e2e29e6ff
commit e072226aad
2 changed files with 20 additions and 40 deletions

View File

@ -63,22 +63,28 @@ Assembly: Start with putting the slots of the inner walls together. Then add the
self.move(tw, th, move) self.move(tw, th, move)
def sideWall(self, extra_height=0.0, foot_height=0.0, move=None): def sideWall(self, extra_height=0.0, foot_height=0.0, edges="šFf", move=None):
t = self.thickness t = self.thickness
x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
eh = extra_height eh = extra_height
fh = foot_height fh = foot_height
tw, th = sum(sy) + t * len(sy) + t, max(sh) + eh edges = [self.edges.get(e, e) for e in edges]
tw = sum(sy) + t * len(sy) + t
th = max(sh) + eh + fh + edges[0].spacing()
if self.move(tw, th, move, True): if self.move(tw, th, move, True):
return return
self.edges["š"](y+2*t) self.moveTo(edges[0].margin())
self.edgeCorner("š", "e")
edges[0](y+2*t)
self.edgeCorner(edges[0], "e")
self.edge(fh) self.edge(fh)
self.edges["F"](sh[-1]+eh) self.step(edges[1].startwidth() - t)
self.polyline(0, 90, t) edges[1](sh[-1]+eh)
self.edgeCorner(edges[1], "e")
for i in range(len(sy)-1, 0, -1): for i in range(len(sy)-1, 0, -1):
self.edge(sy[i]) self.edge(sy[i])
if sh[i] > sh[i-1]: if sh[i] > sh[i-1]:
@ -87,10 +93,12 @@ Assembly: Start with putting the slots of the inner walls together. Then add the
else: else:
self.polyline(0, -90, sh[i-1] - sh[i], 90, t) self.polyline(0, -90, sh[i-1] - sh[i], 90, t)
self.fingerHolesAt(-0.5*t, self.burn, sh[i-1]+eh) self.fingerHolesAt(-0.5*t, self.burn, sh[i-1]+eh)
self.polyline(sy[0], 90) self.polyline(sy[0])
self.edges["f"](sh[0]+eh) self.edgeCorner("e", edges[2])
self.polyline(0, -90, t, 90, fh) edges[2](sh[0]+eh)
self.edgeCorner("e", "š") self.step(t - edges[2].endwidth())
self.polyline(fh)
self.edgeCorner("e", edges[0])
self.move(tw, th, move) self.move(tw, th, move)

View File

@ -33,34 +33,6 @@ class SlatwallDrillBox(DrillStand):
"--extra_height", action="store", type=float, default=15.0, "--extra_height", action="store", type=float, default=15.0,
help="height difference left to right") help="height difference left to right")
def sideWall(self, extra_height=0.0, move=None):
t = self.thickness
x, sx, y, sy, sh = self.x, self.sx, self.y, self.sy, self.sh
eh = extra_height
tw, th = sum(sy) + t * len(sy) + t, max(sh) + eh
if self.move(tw, th, move, True):
return
self.moveTo(t)
self.polyline(y+t, 90)
self.edges["B"](sh[-1]+eh)
self.polyline(0, 90, t)
for i in range(len(sy)-1, 0, -1):
self.edge(sy[i])
if sh[i] > sh[i-1]:
self.fingerHolesAt(0.5*t, self.burn, sh[i]+eh, 90)
self.polyline(t, 90, sh[i] - sh[i-1], -90)
else:
self.polyline(0, -90, sh[i-1] - sh[i], 90, t)
self.fingerHolesAt(-0.5*t, self.burn, sh[i-1]+eh)
self.polyline(sy[0], 90)
self.edges["f"](sh[0]+eh)
self.corner(90)
self.move(tw, th, move)
def render(self): def render(self):
# Add slat wall edges # Add slat wall edges
s = edges.SlatWallSettings(self.thickness, True, s = edges.SlatWallSettings(self.thickness, True,
@ -82,7 +54,7 @@ class SlatwallDrillBox(DrillStand):
self.rectangularWall(x/math.cos(bottom_angle)-t*math.tan(bottom_angle), y, "fefe", callback=[self.bottomCB], move="up") self.rectangularWall(x/math.cos(bottom_angle)-t*math.tan(bottom_angle), y, "fefe", callback=[self.bottomCB], move="up")
self.sideWall(move="right") self.sideWall(edges="eBf", move="right")
for i in range(1, len(sx)): for i in range(1, len(sx)):
self.yWall(i, move="right") self.yWall(i, move="right")
self.sideWall(self.extra_height, move="right") self.sideWall(self.extra_height, edges="eBf", move="right")