Drawbot_image_to_gcode_v2
Drawbot_image_to_gcode_v2 copied to clipboard
cropped and rotated image/canvas
I use processing-3.3.4 to test and it seems like there is a hardcoded w/h ratio in the process. All images are centered and cropped with 4:3 ratio (or so, I don't know). Also all images I tried, even some of your included sample images in the pics folder, are rotated 90° CCW. It is easily fixed with the rotation feature you provided, but this only applied to the onscreen render. The generated pdf file is still has incrrect orientation. I don't know if the images from g-code would have correct orientation as I don't work with g-code. I don't have programms that render g-code to image. Here is an image to show you the cropped result, left and right parts of the original image was cut off:
Thanks for your work :)
Hey NoPinky, I really appreciate the comments.
My particular robot draws better if I draw rectangular images vertically. Therefore I purposely rotate all my gcode to be taller than wide. If you don't want this bug/feature, comment out image_rotate(); in the setup_squiggles function. Unfortunately, right now, this also messes up other stuff like the directional strokes.
The auto center-crop can also be avoided by commenting out image_crop(); in the pre_processing() function.
I will also be adding a wiki to better describe my weird coordinate system, etc. Hope this helps.
Hi @Scott-Cooper the wiki is still empty as it stands.
I'm quite curious about the crop. I'm also very much looking for a way to invert the Y-axis gcode for a normal pen plotter model. I've made my own pen plotter and am having a hard time figuring out where I can flip the Y-axis direction. I have found comments that someone has removed the - sign and added a - sign to the Y-gcode commands but somehow my gcode does not contain any negative values for Y.
Would there be a solution I can try out? Sorry for posting this in this topic, since I had two questions I thought I'd combine them since they are simple questions.
Thanks for this wonderful script, I am really having a good time with this!