Is there a way to force an SVG to force paths to be a polygon primitive? Paths currently have an issue rendering in the software I need them, and since I don't need any features a path would afford me I'd like them all to be polygons.
I am aware illustrator does this by default, but once a line has a curve in it it is marked as a path and will never be exported as a polygon despite not having any curves, and being a closed contiguous shape. I would like a way to

The path in question below only uses a single M and multiple Line To(L)/Horizontal Line To(H) in its pathdata, so there are no bezier curves to justify it being a path.


https://betravis.github.io/shape-tools/path-to-polygon/ is a solution but I'd like something I can do automate or at the very least do locally for quality of life reasons.

Converting the points to corners with the direct selection tool will NOT work, the line will still be exported as a path.

  • I can not replicate your issue. If i make a part curved and then reset all corners back to hard it again with the anchor points tool exports a polygon. Also have you tried simplify path with straight lines option.
    – joojaa
    Commented Dec 16, 2016 at 14:29

1 Answer 1


I tried some SVG capable apps and found out that opening and exporting your path in Sketch does indeed convert the path to a polygon.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.