evildmp / BrachioGraph

BrachioGraph is an ultra-cheap (total cost of materials: €14) plotter that can be built with minimal skills.
https://www.brachiograph.art
MIT License
680 stars 114 forks source link

Creating json lines from image with image_to_json fails with error #124

Open lriley2020 opened 1 year ago

lriley2020 commented 1 year ago

Sorry in advance if I'm doing something stupid here! I've been trying to convert a png image to json to plot it, but when I import linedraw and run image_to_json, I get the following error:

>>> from linedraw import *
>>> image_to_json("imagename", draw_contours=2, draw_hatch=16, repeat_contours=3)
generating contours...
finding edges...
getting contour points...
connecting contour points...
getting contour points...
connecting contour points...
optimizing stroke sequence...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 36, in image_to_json
    lines=vectorise(
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 120, in vectorise
    contours = sortlines(getcontours(
  File "/Users/liamriley/bg/BrachioGraph/linedraw.py", line 329, in sortlines
    slines = [clines.pop(0)]
IndexError: pop from empty list
>>> 

Is there an issue with the code?