gears.py: Support non closed line segments in drawPoints()
This commit is contained in:
parent
33681db645
commit
accb6eb45d
|
@ -384,13 +384,13 @@ class Gears():
|
||||||
dest="undercut_alert", default=False,
|
dest="undercut_alert", default=False,
|
||||||
help="Let the user confirm a warning dialog if undercut occurs. This dialog also shows helpful hints against undercut")
|
help="Let the user confirm a warning dialog if undercut occurs. This dialog also shows helpful hints against undercut")
|
||||||
|
|
||||||
def drawPoints(self, lines, kerfdir=1):
|
def drawPoints(self, lines, kerfdir=1, close=True):
|
||||||
|
|
||||||
if not lines:
|
if not lines:
|
||||||
return
|
return
|
||||||
|
|
||||||
if kerfdir != 0:
|
if kerfdir != 0:
|
||||||
lines = kerf(lines, self.boxes.burn*kerfdir)
|
lines = kerf(lines, self.boxes.burn*kerfdir, closed=close)
|
||||||
|
|
||||||
self.boxes.ctx.save()
|
self.boxes.ctx.save()
|
||||||
self.boxes.ctx.move_to(*lines[0])
|
self.boxes.ctx.move_to(*lines[0])
|
||||||
|
@ -398,6 +398,7 @@ class Gears():
|
||||||
for x, y in lines[1:]:
|
for x, y in lines[1:]:
|
||||||
self.boxes.ctx.line_to(x, y)
|
self.boxes.ctx.line_to(x, y)
|
||||||
|
|
||||||
|
if close:
|
||||||
self.boxes.ctx.line_to(*lines[0])
|
self.boxes.ctx.line_to(*lines[0])
|
||||||
self.boxes.ctx.restore()
|
self.boxes.ctx.restore()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue