Can't get outlines from an svg


I’m trying to get the outlines from a simple svg but it just doesnt work. Do the files have to be in a special format? The tiger.svg in the examples works without any problems but I cant get others to work. Tried this image but i just get the warning " need at least 3 points".

Many many thanks!

Hi there!

openFrameworks uses the libsvgtiny library to parse svgs, and unfortunately it doesn’t support all formats of SVG. You’ll need to convert your file to “svg tiny” format - you can use illustrator or Inkscape to do this.

hope this helps!


1 Like

you could try to run it through an optimiser, maybe that helps.
svgo usually does a good job:

also validating if it is proper xml and svg cannot hurt:

1 Like

Fixed it by changing to a smaller svg format witch I think was tinysvg and making sure it was exported with lines. It was just a filled shape before that.

1 Like

You should get the outlines for filled shapes but glad it worked out either way

1 Like

I’m a little hazy on this but I think in the past I’ve had issues getting outlines from filled shapes from SVG if the winding order is different than normal – I don’t know if that’s set in the SVG or not but I’ve def had to muck around with the winding order on ofPath object to get it to return polylines – see the getOutline function here to see where it returns polylines only if winding mode is OF_POLY_WINDING_ODD: