SVG to G-code... "hello world" !

Today I wanted to print more with doing less work. Making the previous program took quite some time and concentration for making some straight lines. Nothing Fancy about that.

I wanted to have a program where you can print (plot) fancy work. In a way that drawings made by my kids (when they will do so in the future) can be plotted. I searched and found an Inkscape extension (I frequently use Inkscape). It didn't work for me.

What I actually wanted was to get all the points from a line and convert them to coordinates in G-code. Basically it means instructing a machine to go to point X... Y...

Here is how I came from this:

to this:

I needed to investigate the .svg file to see if I could easily change the coordinates. I opened Inkscape and first drew a simple line consisting of a few points. I found out that (0,0) is the upper left corner of the canvas. I drew the line in millimeters but the .svg file gives coordinates in 'px' (pixels). After some calculating I decided to scale the line in Inkscape so my coordinates would be in mm. (90 dpi (pixels per inch) gives 28,222 pixels per mm so the line needed to be scaled to 28,2222 percent of the original size)

What is x and y in Inkscape translates to y and x in the .svg file... good to know.

Now the file needs to be opened in a text editor. I highly recommend Sublime Text 2 for this since it is a very powerful editor (I'll come to that later on).

Here are the coordinates:

Delete the rest of the file since we don't need it. Also in my case the first coordinate was written as 0,-1.484375e-5. I changed it to 0,0

Now here's what is so shizzle about Sublime Text... Select one space, and with a shortcut you can select ALL spaces. If you then press "backspace" and after that "enter" and type "G1 Y" you have changed all spaces in "G1 Y"!!! Timesaver!!!

Select all spaces:

Change all spaces:

The same goes for the comma, select "," and change all to " X"

Finish the textfile (add other G-code for putting the pen on paper etc) and it is ready to use for printing...


First 3D printer output

Today Kees brought the 3D printer. After setting the dimensions to the correct sizes and recompiling the firmware it moved! "It's ALIVE!"

Accuracy needs to be improved, I do not have homing switches mounted yet so I guestimated the zero positions.

The first question I got from my kids after seeing the head move op 10 cm (G1 X0 Y0 Z100 F9000) was: "What else does it do?"

I took my bloc note, made a sketch and manually programmed the G-codes (with 2 hyper boys next to me testing the limits of my concentration) to show them what this contraption can do more.

Below is the result. Programmed in 15 minutes (with in-between-tests), printed in approx. 4 seconds...