fix issue with sorting chunks

Infinite loop was caused by don't merge paths option. This option can
cause chunks to intersect, and then seemed for the algorithm as one
inside each other, thus causing a parent-child loop.
Important to mention is the fact, that don't merge outlines is an exotic
option which is there ONLY for milling PCB's,...
pull/25/head
vilemnovak 2015-12-31 02:19:15 +01:00
rodzic 44996564bd
commit e0b43951ea
1 zmienionych plików z 3 dodań i 1 usunięć

Wyświetl plik

@ -1575,6 +1575,7 @@ def sortChunks(chunks,o):
sortedchunks.append(ch)
lastch = ch
pos = lastch.points[-1]
print(i, len(chunks))
# experimental fix for infinite loop problem
#else:
# can't find chunks close enough and still some chunks left
@ -2381,7 +2382,8 @@ def strategy_cutout( o ):
#parentChildPoly(chunksFromCurve,chunksFromCurve,o)
chunksFromCurve=limitChunks(chunksFromCurve,o)
parentChildPoly(chunksFromCurve,chunksFromCurve,o)
if not o.dont_merge:
parentChildPoly(chunksFromCurve,chunksFromCurve,o)
if o.outlines_count==1:
chunksFromCurve=sortChunks(chunksFromCurve,o)