Stypox / image-to-gcode

Detects the edges of an image and converts them to 2D gcode that can be printed by a plotter
25 stars 9 forks source link

Never Stoped #4

Open OmarObando opened 6 months ago

OmarObando commented 6 months ago

Hi, I ready try to run the program, but never end in my terminal and I had to stop from keyaboard, If I let running never stoped, any suggestions?

Stypox commented 6 months ago

You can try to resize the image you are passing to the script beforehand, since if it's too big it's going to take long

OmarObando commented 6 months ago

Alrdy, I tried different resolution, and something work or something doesn't work, another question the size of gcode is in millimeters?, and the second is exist a form to define the size? ty <3

Stypox commented 6 months ago

There is no option to change gcode size, but you should get away by editing the file and multiplying x and y by a constant at the following lines: https://github.com/Stypox/image-to-gcode/blob/master/image_to_gcode.py#L84 https://github.com/Stypox/image-to-gcode/blob/master/image_to_gcode.py#L106 https://github.com/Stypox/image-to-gcode/blob/master/image_to_gcode.py#L137

OmarObando commented 6 months ago

It worked <3, ty, some question more, I want to add like a pen up and pen down, it's posible?, something when move to another section that isn't connected with the actual point up the pen and then down?

Btw Idk why some img get this error

RecursionError: maximum recursion depth exceeded in comparison

The img Is this

photo

Stypox commented 5 months ago

I want to add like a pen up and pen down, it's posible?

That's what should already be happening. Commands starting with G1 are with pen down, while with G0 pen up. Although your plotter might interpret them differently, so you might want to e.g. find-and-replace all G0s with another command that makes the pen go up specific to your plotter (I am not knowledgeable enough about this topic to give clearer indications unfortunately).

RecursionError: maximum recursion depth exceeded in comparison

Yeah this tool is pretty basic, so with bigger images it can easily take too much time or memory, thus running into these kinds of errors.