Fix ChestHinge

Add the play of the hinge to the width of the edge
Adjust IntegratedHingeBox
Fixes #45
This commit is contained in:
Florian Festi 2017-12-07 22:24:15 +01:00
parent 319b1f869f
commit 9dfa95f45b
2 changed files with 19 additions and 5 deletions

View File

@ -1156,16 +1156,29 @@ class ChestHingeTop(ChestHinge):
p = self.settings.pin_height
s = self.settings.hinge_strength
play = 0.1 * self.settings.thickness
poly = (0, -180, t, -90, play, -90, 0, (-90, p+s+play), 0, 90, l+t-p-s-play)
poly = (0, -180, t, -180, 0, (-90, p+s+play), 0, 90, l+t-p-s-play)
if self.reversed:
poly = reversed(poly)
self.polyline(*poly)
def startwidth(self):
play = 0.1 * self.settings.thickness
if self.reversed:
return play+self.settings.pin_height+self.settings.hinge_strength
return 0
def endwidth(self):
play = 0.1 * self.settings.thickness
if self.reversed:
return 0
return play+self.settings.pin_height+self.settings.hinge_strength
def margin(self):
if self.reversed:
return 0.
else:
return 1*(self.settings.pin_height+self.settings.hinge_strength)
play = 0.1 * self.settings.thickness
return 1*(play+self.settings.pin_height+self.settings.hinge_strength)
class ChestHingePin(BaseEdge):

View File

@ -45,19 +45,20 @@ class IntegratedHingeBox(Boxes):
t = self.thickness
hx = self.edges["O"].startwidth()
hx2 = self.edges["P"].startwidth()
e1 = edges.CompoundEdge(self, "Fe", (h-hx, hx))
e2 = edges.CompoundEdge(self, "eF", (hx, h-hx))
e_back = ("F", e1, "e", e2)
self.rectangularWall(x, h-hx, "FfOf", ignore_widths=[2], move="up")
self.rectangularWall(x, hl-hx, "pfFf", ignore_widths=[1], move="up")
self.rectangularWall(x, hl-hx2, "pfFf", ignore_widths=[1], move="up")
self.rectangularWall(x, h-hx, "Ffof", ignore_widths=[5], move="up")
self.rectangularWall(x, hl-hx, "PfFf", ignore_widths=[6], move="up")
self.rectangularWall(x, hl-hx2, "PfFf", ignore_widths=[6], move="up")
self.rectangularWall(y, h, "FFeF", move="up")
self.rectangularWall(y, h, e_back, move="up")
self.rectangularWall(y, hl, "FFeF", move="up")
self.rectangularWall(y, hl-hx, "FFqF", move="up")
self.rectangularWall(y, hl-hx2, "FFqF", move="up")
self.rectangularWall(x, y, "ffff", move="up")
self.rectangularWall(x, y, "ffff")