sebleedelisle / ofxLaser

An openFrameworks addon for controlling multiple lasers.
Mozilla Public License 2.0
258 stars 32 forks source link

Adobe Illustrator created SVG files are not displayed #35

Closed eighteight closed 2 years ago

eighteight commented 2 years ago

In the attachment I put an example of an SVG file, created in Adobe Illustrator, using "File" -> "Export As"–>"SVG" options:

Screenshot 2022-05-06 at 3 16 48 PM

This file does not throw any errors while read in ofxLaser SVG example, but does not render either.

What is the recommended workflow for creating SVG files for usage in ofxLaser?

Thanks laser-test laser-test.svg.zip

sebleedelisle commented 2 years ago

Hi there,

the system uses libtinysvg (the same as in ofxSvg) and it's very fussy! I've added additional parsing to catch some common insufficiencies in the library but it's still a bit temperamental.

Try exporting from AI in SVGTiny format - it should be one of the options (although I no longer have AI so can't test). Otherwise use Inkscape which seems to work better.

If you want more detail, It seems that the issue in your SVG is the style definition (it seems to work when the style definition is inline - see attached example) so you can always manually edit them if you continue to have issues. Hope this helps!

Seb laser-test6

eighteight commented 2 years ago

@sebleedelisle svgtiny 1.1 option in AI works!

Screenshot 2022-05-06 at 4 25 29 PM

Thanks a lot for your help! laser-test1.svg.zip

sebleedelisle commented 2 years ago

Glad I could help!