jankovicsandras / imagetracerjs

Simple raster image tracer and vectorizer written in JavaScript.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Creating plotter-path possible?

ld21 opened this issue · comments

Hi – I like your code, very fascinating. I'm would like to build a simle plotter run by an ESP32 that receives it's drawing path from an SVG calculated by the browser. Since I'm not familiar with all the options you have in your imagetracerjs, could you recommend options so that I would get something as can be seen in the picture below? Thank you very much, Dani

original_and_traced_version
Left: Original, pixelbased photo / Right: Calculated SVG

For this project, I was inspired by https://www.brachiograph.art/.

Hi,

Yes, it's possible. As I understand, the ESP32 plotter uses G-code . The simplest solution is translating SVG draw commands directly to G-code commands. I found this https://github.com/em/gcanvas which can convert canvas draw commands. It should be very easy to adapt to ImageTracer, since ImageTracer uses only SVG paths and only M, L, Q and Z commands.

This might not be optimal for a BrachioGraph-like arm-writer, but it's a good start.

I hope this helped. Feel free to reopen this Issue if you have more questions.