xxxxxxxxxx
22
/* export SVG
DDF 2019
need to have p5.svg.js in project and in index.html
see -https://github.com/zenozeng/p5.js-svg
this will save an SVG file in your download folder
*/
function setup() {
createCanvas(200, 200, SVG); // Create SVG Canvas
strokeWeight(1); // do 0.1 for laser
stroke(255, 0, 0); // red is good for laser
noFill(); // better not to have a fill for laser
}
function draw() {
// stuff here
ellipse(width/2,height/2,50,50);
save("mySVG.svg"); // give file name
print("saved svg");
noLoop(); // we just want to export once
}