correct split with angle fill and hole with sharp corner

pull/2/head
Serg Stetsuk 2016-12-07 03:23:55 +02:00
rodzic 3453aa239d
commit 2fe1f6f8a4
1 zmienionych plików z 7 dodań i 0 usunięć

Wyświetl plik

@ -868,6 +868,13 @@ class SergFill(EmbroideryElement):
return shgeo.LineString(segment1).distance(shgeo.LineString(segment2))
def is_same_run(self, segment1, segment2):
#if we have intersection due to hole with sharp corner and an angle fill
dist=shgeo.Point(segment1[0]).distance(shgeo.Point(segment1[1]))
dist1=shgeo.Point(segment1[0]).distance(shgeo.LineString(segment2))
dist2=shgeo.Point(segment1[1]).distance(shgeo.LineString(segment2))
if (dist1 > dist-self.row_spacing or dist2 > dist-self.row_spacing) and dist > self.row_spacing * 3:
return False
if self.inter_distance(segment1, segment2) <= self.row_spacing * 1.001:
return True
return False