rectangularTriangle: Fix outset edges in hypothenuse
This commit is contained in:
parent
cd604f0d53
commit
8030faadd6
|
@ -1936,6 +1936,7 @@ class Boxes:
|
||||||
raise ValueError("two or three edges required")
|
raise ValueError("two or three edges required")
|
||||||
|
|
||||||
r = min(r, x, y)
|
r = min(r, x, y)
|
||||||
|
alpha = math.degrees(math.atan2(y-r, float(x-r)))
|
||||||
|
|
||||||
width = x + edges[-1].spacing() + edges[1].spacing()
|
width = x + edges[-1].spacing() + edges[1].spacing()
|
||||||
height = y + edges[0].spacing() + edges[2].spacing()
|
height = y + edges[0].spacing() + edges[2].spacing()
|
||||||
|
@ -1946,7 +1947,6 @@ class Boxes:
|
||||||
overallwidth = width * (num // 2 + num % 2)
|
overallwidth = width * (num // 2 + num % 2)
|
||||||
overallheight = height
|
overallheight = height
|
||||||
|
|
||||||
alpha = math.degrees(math.atan2(y-r, float(x-r)))
|
|
||||||
|
|
||||||
if self.move(overallwidth, overallheight, move, before=True):
|
if self.move(overallwidth, overallheight, move, before=True):
|
||||||
return
|
return
|
||||||
|
@ -1968,11 +1968,15 @@ class Boxes:
|
||||||
edges[i](l,
|
edges[i](l,
|
||||||
bedBolts=self.getEntry(bedBolts, i),
|
bedBolts=self.getEntry(bedBolts, i),
|
||||||
bedBoltSettings=self.getEntry(bedBoltSettings, i))
|
bedBoltSettings=self.getEntry(bedBoltSettings, i))
|
||||||
|
if i==0:
|
||||||
self.edgeCorner(edges[i], edges[i + 1], 90)
|
self.edgeCorner(edges[i], edges[i + 1], 90)
|
||||||
|
self.edgeCorner(edges[i], "e", 90)
|
||||||
|
|
||||||
self.corner(alpha, r)
|
self.corner(alpha, r)
|
||||||
self.cc(callback, 2)
|
self.cc(callback, 2)
|
||||||
|
self.step(edges[2].startwidth())
|
||||||
edges[2](((x-r)**2+(y-r)**2)**0.5)
|
edges[2](((x-r)**2+(y-r)**2)**0.5)
|
||||||
|
self.step(-edges[2].endwidth())
|
||||||
self.corner(90-alpha, r)
|
self.corner(90-alpha, r)
|
||||||
self.corner(90)
|
self.corner(90)
|
||||||
self.ctx.stroke()
|
self.ctx.stroke()
|
||||||
|
|
Loading…
Reference in New Issue