Closed kcajf closed 4 years ago
Here is a full example of when this would be useful:
raw.svg.txt opt_basic.svg.txt opt_split.svg.txt
(github doesn't allow uploading .svgs, hence the .txt extension)
raw is the very original svg - no sorting applied. opt_basic is after linesorting the original svg with vpype (and some scaling etc) opt_split is after splitting the original SVG paths into single-segment paths using svgsort, then linesorting with vpype.
The reason the original file has large multi-segment paths is that they are administrative streets from OSM, not straight subsegments. The third file is far more optimal, due to the fact that street segments have many more intersections with other street segments that full streets with full streets.
I'm looking at the files right now. May I ask the exact options you used when calling svgsort
before vpype
in the third case?
Hi,
Really enjoying using vpype - it's almost perfect for my usecase. Thanks for working on it. The only thing it's missing is the ability to split apart compound SVG paths like the following:
Splitting these apart into many single-segment
<path>
elements can, for certain types of drawing, allow for significantly more optimal draw paths. Currently, vpype doesn't seem to split these apart, and instead just re-orders them amongst themselves.svgsort does have an option for this: https://github.com/inconvergent/svgsort/blob/master/svgsort/__init__.py#L86 For now, I've been using this as a pre-processor before vpype, and it's helped a lot for my drawings. Having this as a layer in vpype would be super cool!