by inconvergent

inconvergent /svgsort

svg path sorter for more efficient (pen)plotting.

144 Stars 4 Forks Last release: over 1 year ago (v2.0.0) Other 33 Commits 1 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Svg Spatial Sort

Reasonably efficient, greedy, path planning for plotting svg files.


Install locally using:

./ [install | develop] --user


Use from the terminal like this:

svgsort input.svg out.svg

This will break down paths into continous sub paths before sorting. it will also allow travelling along paths (once) in both directions.

The default behaviour is to fit the result into an A3 sheet of paper. It will automatically rotate the paper orientation for the best possible fit, as well as align the drawing to the center. You can override the paper size by using

or, eg.,
. To disable centering entirely use

To ensure every path is drawn twice (once in each direction), you can use


You can disable splitting with

. To see other options:
svgsort --help


The code in

is from With only minor changes by me. I had a number of strange issues when installing it via
, so I decided to include it here. See the LICENSE file.


Strip out larger parts of svgpathtools, and refactor?


This code is a tool for my own use. I release it publicly in case people find it useful. It is not however intended as a collaboration/Open Source project. As such I am unlikely to accept PRs, reply to issues, or take requests.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.