Closed golanlevin closed 4 years ago
Hi Golan,
I think how I would approach SVG is to load it with Processing, rasterize it on a canvas, and then use the image() or hatchRaster() routines to re-vectorize them. We'll be doing this anyways even if we obtain the original vector.
I think the SVG spec is pretty huge and not very practical to write a parser for. Processing has a baseline 2000 line parser that parses SVG into its internal format PShape, which I'll need to parse again to make use of. So I think the easiest (and most robust) approach will be to rasterize and trace.
arc square and rounded looks pretty simple to add!
Hi @golanlevin
All done! 5e1834239ca3d2184f032af6bba6cd5547af5170
Excellent!
Hi Lingdong, For thoroughness and compatibility with Processing, could you please add the following to PEmbroider:
This is more complex, but could you also add support for loading SVG files. Ideally this would use Processing's PShape code: https://processing.org/reference/PShape.html
Here is the code for a sample SVG to get you started, the rubber duck:
Although it's outside the official Processing spec, it would also be cool to add Alexandre B A Villares' "arcVertex":