Giter Site home page Giter Site logo

svgsort's Introduction

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.

svgsort's People

Contributors

inconvergent avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.