←back to thread

An SVG is all you need

(jon.recoil.org)
258 points sadiq | 1 comments | | HN request time: 0.216s | 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. nawgz ◴[] No.46238966[source]
I seem to remember that the DOM nodes themselves expose some pretty useful functions. I think it was in the context of detecting edge crossings for a graph router, but you were able to interact with the computed/rendered coordinates in this context.

Sorry that's not more useful and explicit, it was a while back and never went anywhere.