patterncollider icon indicating copy to clipboard operation
patterncollider copied to clipboard

Feature request: Export to SVG

Open jackwh opened this issue 3 years ago • 4 comments

It would be amazing if we could export not only to PNG, but to SVG as well. It looks like this might be possible using https://github.com/zenozeng/p5.js-svg

Thanks for a great creative tool! 🙏 Pattern Collider is a lot of fun to play with.

jackwh avatar Dec 06 '22 15:12 jackwh

Hi! I agree SVG export would be a great feature to add! p5js-svg sounds like a great option here.

One concern I have is switching from canvas to svg altogether may adversely affect performance (although it seems worth trying). If that's the case, maybe we could do a hybrid approach where we keep the p5 canvas as is for the interactivity, but use the p5js-svg library for exporting to svg.

Unfortunately I don't have much time to spend on developing this project, but I welcome input and/or a pull request on this front!

aatishb avatar Dec 06 '22 18:12 aatishb

Hi, I just added SVG export. Currently it replaces the PNG export. Maybe a nice future issue would be to include a dropdown to let you chose PNG or SVG.

I haven't tested the SVG export much, so let me know if you run into any issues with it!

aatishb avatar Dec 13 '22 04:12 aatishb

And thanks for suggesting the p5.js-svg library!

aatishb avatar Dec 13 '22 04:12 aatishb

@aatishb Thanks so much! Just put it to the test with an AxiDraw and ballpoint pens... The SVG works perfectly, you can see the results below 😎 Neat!

IMG_2255

axidraw

jackwh avatar Dec 13 '22 15:12 jackwh