• Stars
    star
    241
  • Rank 167,643 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created almost 7 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

svg path sorter for more efficient (pen)plotting.

Svg Spatial Sort

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

Install

Install locally using:

./setup.py [install | develop] --user

Use

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 --dim=A4 or, eg., --dim=30x40. To disable centering entirely use --no-adjust.

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

You can disable splitting with --no-split. To see other options:

svgsort --help

Credits

The code in svgsort/svgpaththools is from https://github.com/mathandy/svgpathtools. With only minor changes by me. I had a number of strange issues when installing it via pip, so I decided to include it here. See the LICENSE file.

Todo

Strip out larger parts of svgpathtools, and refactor?

Contributing

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.

More Repositories

1

weird

Generative art in Common Lisp
Common Lisp
1,563
star
2

snek

See https://github.com/inconvergent/weir instead
Common Lisp
733
star
3

differential-line

a generative algorithm
Python
674
star
4

weir

(deprecated) A system for making generative systems
Common Lisp
633
star
5

sand-spline

generative algorithm
Python
299
star
6

tree

An algorithm that draws procedurally generated trees.
Python
183
star
7

fracture

generative algorithm
Python
119
star
8

inconvergent-sandbox

Interactive demos written in p5.js
JavaScript
115
star
9

hyphae

Python
97
star
10

gridfont

grid-based system for designing simple symbols and fonts. including an example font. mainly intended for plotter drawings.
Python
95
star
11

fn

python library for generating file names based on current time and git commit.
Python
89
star
12

differential-mesh

generative algorithm
Python
84
star
13

differential-lattice

a generative algorithm using CUDA
Python
73
star
14

desert

A fast (?) random sampling drawing library
Python
65
star
15

differential-mesh-3d

a generative algorithm
Python
55
star
16

hyphae_ani

generative algorithm
Python
49
star
17

orbitals

A generative algorithm. See inconvergent/orbitals_speedup
Python
48
star
18

sand-glyphs

generative algorithm
Python
46
star
19

cl-grph

In-Memory Immutable Graph Structure with Datalog Query Language in Common Lisp
Common Lisp
45
star
20

linearx-font

Procedurally generated fonts
Python
44
star
21

auxin

Auxiliary Common Lisp Utilities for Generative Art
Common Lisp
43
star
22

cl-veq

Vector mathematics DSL and utilities in Common Lisp
Common Lisp
41
star
23

boids

More or less an implementation of Boids flocking algorithm.
Python
36
star
24

orbitals_speedup

Python
36
star
25

simple-circle-packing

brief intro to python + cairo for visualization/drawing
Python
33
star
26

leaf-cuda

leaf venation algorithm. work in progress
Python
28
star
27

axidraw-xy

WARNING: THIS IS OUTDATED AND UNMAINTAINED.
Python
27
star
28

fast-sand-paint

fast wrapper around some pixel manipulation
Python
26
star
29

tracepath-spline

A generative algorithm that draws wave-like lines.
Python
24
star
30

fracture-cuda

Python
22
star
31

differential-line-cuda

CUDA implementation of Differential Line
Python
20
star
32

svg-sorter

spatially sorts all lines in a svg, and creates new svg that is reasonably efficient for plotting.
Python
17
star
33

render

[unmaintained] helpers used to draw and animate with python (cairo)
Python
14
star
34

talks

Notes from presentations I've given.
Python
14
star
35

iutils

[DEPRECATED] utility functions for several generative algorithms.
Python
11
star
36

wind

Python
10
star
37

ddd-utils

[unmaintained] helpers used in various generative algorithm pieces (random, vectors, import/export)
Python
9
star
38

zonemap

unmaintained
Python
8
star
39

automata

unmaintained
Python
7
star
40

differential_ani

[outdated, see https://github.com/inconvergent/differential-line]
Python
7
star
41

differential-cloud

Work in progress.
Python
7
star
42

leaf

Python
6
star
43

xmsmfem

A parallel Multiscale Mixed Finite Element Method for the Matlab Reservoir Toolbox using the Matlab Parallel Computing Toolbox
MATLAB
6
star
44

annotate

adhoc system for annotating image quality and storing the result in a csv
Python
5
star
45

orbitals_ani

A generative algorithm.
Python
5
star
46

sand-pillars

unmaintained
Python
5
star
47

differential-line-mpi

Python
5
star
48

brush-test

JavaScript
4
star
49

sand-dunes

unmaintained
Python
4
star
50

inconvergent

4
star
51

zet

Python
3
star
52

ccvt

Python
3
star
53

zonemap-3d

unmaintained
Python
2
star
54

kinect-glitter

JavaScript
2
star
55

win-vin

2
star
56

jqn

JSON query and transform terminal utility and Common Lisp library
Common Lisp
2
star
57

stacker

Python
1
star
58

orbitals_multicanvas

Python
1
star
59

stm

Finite State Machine Utilities
Common Lisp
1
star