Skip to content

Commit

Permalink
include (slighlty tweaked) svgpathtools in repo. refactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
inconvergent committed Feb 25, 2019
1 parent 516c13a commit 86ccf56
Show file tree
Hide file tree
Showing 29 changed files with 13,352 additions and 8,438 deletions.
63 changes: 62 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@

You are not allowed to sell the svg-files (linearx) in the test folder, but you
are encouraged to plot them.


Svgsort is written by Anders Hoff:


The MIT License (MIT)

Copyright (c) 2017-2019 Anders Hoff

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



The code in svgpathtools is from /~https://github.com/mathandy/svgpathtools:


The MIT License (MIT)

Copyright (c) 2017 Anders Hoff
Copyright (c) 2015 Andrew Allan Port

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -20,3 +55,29 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



Which in turn is based on /~https://github.com/regebro/svg.path:


The MIT License (MIT)

Copyright (c) 2013-2014 Lennart Regebro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 16 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,22 @@ To see other options, use

svgsort --help

## Credits

## CONTRIBUTING
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.

This code is a tool that I have written 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.

## 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.

8 changes: 8 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from svgsort import main

if __name__ == '__main__':
main()

40 changes: 12 additions & 28 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,16 @@
from setuptools import find_packages


dependencies = [
'docopt',
'svgwrite',
'svgpathtools==1.3.3',
]


packages = find_packages()


setup(
name='svgsort',
version='1.1.1',
description='svg spatial sort for plotting',
url='',
license='MIT License',
author='Anders Hoff',
author_email='inconvergent@gmail.com',
install_requires=dependencies,
packages=packages,
entry_points={
'console_scripts': [
'svgsort=svgsort:run'
]
},
dependency_links=['git+/~https://github.com/inconvergent/svgpathtools.git@master#egg=svgpathtools-1.3.3'],
zip_safe=True
)
setup(name='svgsort',
version='2.0.0',
description='svg spatial sort for plotting',
url='/~https://github.com/inconvergent/svgsort',
license='MIT License',
author='Anders Hoff',
author_email='inconvergent@gmail.com',
install_requires=['docopt', 'svgwrite', 'numpy', 'scipy'],
packages=find_packages(),
entry_points={'console_scripts': ['svgsort=svgsort:main']},
zip_safe=True
)

35 changes: 16 additions & 19 deletions svgsort/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@
[--sw=<s>]
[--rnd] [--repeat]
[--nv]
svgsort <in> [<out>] --no-sort
[--a4 | --a3 | --dim=<d>]
[--pad-abs]
[--pad=<p>]
[--sw=<s>]
[--repeat]
[--nv]
svgsort -h
svgsort <in> [<out>] --no-sort [--a4 | --a3 | --dim=<d>]
[--pad-abs]
[--pad=<p>]
[--sw=<s>]
[--repeat]
[--nv]
Options:
--no-reverse DO NOT attempt to reverse path directions.
Expand All @@ -40,10 +38,14 @@
--sw=s stroke width.
--nv not verbose. (verbose is default.)
-h --help show this screen.
--version show version.
Examples:
svgsort input.svg
svgsort input.svg out.svg
svgsort input.svg out.svg --dim=30x40
svgsort input.svg out.svg --a3
svgsort input.svg out.svg --a4
svgsort input.svg out.svg --repeat
"""

Expand All @@ -53,21 +55,16 @@
import sys
import traceback

from docopt import docopt

from svgsort.svgsort import Svgsort
from svgsort.svgsort import PAPER
from svgsort.svgsort import make_paper



def run():

from docopt import docopt
args = docopt(__doc__, version='svgsort 1.1.1')
main(args)


def main(args):
# print(args)
def main():
args = docopt(__doc__, version='svgsort 2.0.0')
try:
_in = args['<in>']
out = args['<out>'] if args['<out>'] else args['<in>']+'-srt'
Expand Down Expand Up @@ -114,5 +111,5 @@ def main(args):


if __name__ == '__main__':
run()
main()

Loading

0 comments on commit 86ccf56

Please sign in to comment.