Best effort to generate isolation path cutting on the conventional side

This commit is contained in:
phdussud
2015-06-19 16:25:22 -07:00
parent cd39a55696
commit f5e481d1fa
2 changed files with 29 additions and 6 deletions

View File

@@ -540,7 +540,8 @@ class Geometry(object):
# If last point in geometry is the nearest
# then reverse coordinates.
if list(pt) == list(candidate.coords[-1]):
# but prefer the first one if last == first
if pt != candidate.coords[0] and pt == candidate.coords[-1]:
candidate.coords = list(candidate.coords)[::-1]
# Straight line from current_pt to pt.
@@ -2689,8 +2690,9 @@ class CNCjob(Geometry):
storage.remove(geo)
# If last point in geometry is the nearest
# but prefer the first one if last point == first point
# then reverse coordinates.
if list(pt) == list(geo.coords[-1]):
if pt != geo.coords[0] and pt == geo.coords[-1]:
geo.coords = list(geo.coords)[::-1]
# G-code