jasonwebb / 2d-diffusion-limited-aggregation-experiments

Visual experiments exploring diffusion-limited aggregation (DLA) as a 2D morphogenesis tool.
https://jasonwebb.github.io/2d-diffusion-limited-aggregation-experiments/
Other
60 stars 10 forks source link

Is there a way to upload your own SVG image? #2

Closed sean-mcclure closed 4 years ago

sean-mcclure commented 4 years ago

I tried placing my own SVG in the folder but it doesn't show the SVG when attempting to grow fractals on text.

jasonwebb commented 4 years ago

The SVG parser is extremely finicky and can really only handle very, very simple SVG files. It only handles shapes that are drawn with <path> tags, and can't handle grouping. I also found that it will refuse to parse SVG files when some attributes are present on the root node which get added automatically by Inkscape.

My best advice is to find (and contribute!) a better way of constructing Path objects from SVG input files. You could also try taking a look at the contents dla.svg and modify your file to look as much like it as possible (same attributes, same tag hierarchy, etc).

kedionai commented 4 years ago

Makes sense. Thanks for all the info. I’ll have a look and see what I can get working. If I find a general solution I’ll submit a PR to contribute. Cheers.