←back to thread

An SVG is all you need

(jon.recoil.org)
281 points sadiq | 2 comments | | HN request time: 0.395s | source
Show context
amelius ◴[] No.46238590[source]
I recently found out that it is surprisingly hard to convert an SVG file that consists of series of line segments into a list of those line segments in Python.

I tried with ChatGPT and Claude but both were not able to find a solution that respects the entire specification, especially transforms.

Initially, my expectation was that there must be a library for this kind of thing, but alas.

replies(5): >>46238679 #>>46238799 #>>46238853 #>>46238966 #>>46239444 #
1. e12e ◴[] No.46238799[source]
I mean - it's XML so you could go that way and extract the d element from path element?

But there seems to be a lot of SVG specific tooling and code to do this in python?

Eg: https://github.com/RaubCamaioni/svgpath

replies(1): >>46238941 #
2. ◴[] No.46238941[source]