Skip to content

Prepare your work

You can’t just throw any file at the machines and expect them to work. You have to consiser some things first.

Vector based

You need a vector based file. Bitmaps (like photographs etc) are simply impossible to plot, cut or embroider. But the conversion from a bitmap to a vector based file, can be an opprtunity on its own. Have a look at the different algorithms at Plotterfun for instance.

As a rule of thumb, aim for SVG files. These are the most versatile, are accepted by many tools and easy to convert.

Some machines only accept G-CODE or HPGL files. This a more low-level format that CNC machines can read.

P5.js vector export

If you want to export your p5.js sketch, you can do this as an SVG with the p5.js-svg library. Make shure you are using the corresponding p5.js version. See the code below or have a look at this demo

<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.6.0/p5.js"></script>
<script src="https://unpkg.com/p5.js-svg@1.5.1"></script>
...
</head>
function setup() {
createCanvas(400, 400, SVG); // Create SVG Canvas
}
function draw() {
/* your drawing code */
}
function keyPressed(){
if(keyCode===ENTER){ //press enter to save
save("exportdemo.svg");
}
}

Lines

You have to think in lines instead of shapes. There is no such things a ‘fill’.

There are some solutions for this, like the Hatch fill in InkScape.

Don’t worry about linethickness too much. The machine will plot the lines with the thickness of the pen you put in the machine.

Color

Color doesn’t matter. It will be plotted in the color of the pen you put in the machine.

On the other hand, things like Saxi use color to split a drawing into certain groups. This can be useful if you want to plot different parts of a drawing with different pens.

Optimizing

Tools like Saxi can optimize your drawing in a way that the pen follows the shortest path.

Vpype can help you with this too. See linesort and linemerge