fix two bugs in running stitch

* the first stitch was duplicated
  * the last stitch was omitted
pull/171/head
Lex Neva 2018-05-28 21:34:58 -04:00
rodzic 9c2350eff7
commit 49b8c9f00b
1 zmienionych plików z 3 dodań i 3 usunięć

Wyświetl plik

@ -16,7 +16,7 @@ def running_stitch(points, stitch_length):
if len(points) < 2:
return []
output = [points[0]]
output = []
segment_start = points[0]
last_segment_direction = None
@ -59,8 +59,8 @@ def running_stitch(points, stitch_length):
last_segment_direction = segment_direction
distance -= segment_length
# stitch the last point unless we're already almos there
if (segment_start - points[-1]).length() > 0.1:
# stitch the last point unless we're already almost there
if (segment_start - output[-1]).length() > 0.1:
output.append(segment_start)
return output