[Python-modules-commits] [python-svg.path] 01/04: Imported Upstream version 2.0
Daniel Stender
danstender-guest at moszumanska.debian.org
Mon Sep 21 13:56:33 UTC 2015
This is an automated email from the git hooks/post-receive script.
danstender-guest pushed a commit to branch master
in repository python-svg.path.
commit ff25230e30775daafed45640d7a11935a1d6539b
Author: Daniel Stender <debian at danielstender.com>
Date: Mon Sep 21 15:48:06 2015 +0200
Imported Upstream version 2.0
---
CHANGES.txt | 57 +++
CONTRIBUTORS.txt | 9 +
LICENSE.txt | 21 ++
MANIFEST.in | 2 +
PKG-INFO | 263 ++++++++++++++
README.rst | 165 +++++++++
setup.cfg | 9 +
setup.py | 54 +++
src/svg.path.egg-info/PKG-INFO | 263 ++++++++++++++
src/svg.path.egg-info/SOURCES.txt | 24 ++
src/svg.path.egg-info/dependency_links.txt | 1 +
src/svg.path.egg-info/namespace_packages.txt | 1 +
src/svg.path.egg-info/pbr.json | 1 +
src/svg.path.egg-info/requires.txt | 1 +
src/svg.path.egg-info/top_level.txt | 1 +
src/svg.path.egg-info/zip-safe | 1 +
src/svg/__init__.py | 1 +
src/svg/path/__init__.py | 2 +
src/svg/path/parser.py | 187 ++++++++++
src/svg/path/path.py | 438 ++++++++++++++++++++++
src/svg/path/tests/__init__.py | 0
src/svg/path/tests/test_doc.py | 7 +
src/svg/path/tests/test_generation.py | 36 ++
src/svg/path/tests/test_parsing.py | 138 +++++++
src/svg/path/tests/test_paths.py | 525 +++++++++++++++++++++++++++
25 files changed, 2207 insertions(+)
diff --git a/CHANGES.txt b/CHANGES.txt
new file mode 100644
index 0000000..b552a91
--- /dev/null
+++ b/CHANGES.txt
@@ -0,0 +1,57 @@
+Changelog
+=========
+
+2.0 (2015-05-15)
+----------------
+
+- Nothing changed yet.
+
+
+2.0b1 (2014-11-06)
+------------------
+
+- Added a Path.d() function to generate the Path's d attribute.
+
+- Added is_smooth_from() on QubicBezier and QuadradicBezier.
+
+- Path()'s now have a .closed property.
+
+- Fixed the representation so it's parseable.
+
+- The calculations for CubicBezier and Arc segments are now recursive,
+ and will end when a specific accuracy has been achieved.
+ This is somewhat faster for Arcs and somewhat slower for CubicBezier.
+ However, you can now specify an accuracy, so if you want faster but
+ looser calculations, you can have that.
+
+- 't' segments (smooth, relative QuadraticBeziers) whose previous segment was
+ not a QuadraticBezier would get an incorrect control point.
+
+
+1.2 (2014-11-01)
+----------------
+
+- New Quadradic Bezier implementation. [Justin Gruenberg]
+
+- Solved issue #6: Z close path behavior. [abcjjy]
+
+
+1.1 (2013-10-19)
+----------------
+
+- Floats with negative exponents work again.
+
+- New tokenizer that is around 20 times faster.
+
+
+1.0 (2013-05-28)
+----------------
+
+- Solved issue #2: Paths with negative values and no spaces didn't work.
+ [regebro]
+
+
+1.0b1 (2013-02-03)
+------------------
+
+- Original release.
diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt
new file mode 100644
index 0000000..c989274
--- /dev/null
+++ b/CONTRIBUTORS.txt
@@ -0,0 +1,9 @@
+Lennart Regebro <regebro at gmail.com>, Original Author
+
+Justin Gruenberg implemented the Quadradic Bezier calculations and
+provided suggestions and feedback about the d() function.
+
+Michiel Schallig suggested calculating length by recursive straight-line
+approximations, which enables you to choose between accuracy or speed.
+
+Thanks also to bug fixers Martin R and abcjjy.
diff --git a/LICENSE.txt b/LICENSE.txt
new file mode 100644
index 0000000..a46b4b0
--- /dev/null
+++ b/LICENSE.txt
@@ -0,0 +1,21 @@
+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.
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..f218bf2
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include *.rst
+include *.txt
diff --git a/PKG-INFO b/PKG-INFO
new file mode 100644
index 0000000..615b6a0
--- /dev/null
+++ b/PKG-INFO
@@ -0,0 +1,263 @@
+Metadata-Version: 1.1
+Name: svg.path
+Version: 2.0
+Summary: SVG path objects and parser
+Home-page: https://github.com/regebro/svg.path
+Author: Lennart Regebro
+Author-email: regebro at gmail.com
+License: MIT
+Description: svg.path
+ ========
+
+ svg.path is a collection of objects that implement the different path
+ commands in SVG, and a parser for SVG path definitions.
+
+
+ Usage
+ -----
+
+ There are four path segment objects, ``Line``, ``Arc``, ``CubicBezier`` and
+ ``QuadraticBezier``.`There is also a ``Path`` object that acts as a
+ collection of the path segment objects.
+
+ All coordinate values for these classes are given as ``complex`` values,
+ where the ``.real`` part represents the X coordinate, and the ``.imag`` part
+ representes the Y coordinate.
+
+ >>> from svg.path import Path, Line, Arc, CubicBezier, QuadraticBezier
+
+ All of these objects have a ``.point()`` function which will return the
+ coordinates of a point on the path, where the point is given as a floating
+ point value where ``0.0`` is the start of the path and ``1.0`` is end end.
+
+ You can calculate the length of a Path or it's segments with the
+ ``.length()`` function. For CubicBezier and Arc segments this is done by
+ geometric approximation and for this reason **may be very slow**. You can
+ make it faster by passing in an ``error`` option to the method. If you
+ don't pass in error, it defaults to ``1e-12``.
+
+ >>> CubicBezier(300+100j, 100+100j, 200+200j, 200+300j).length(error=1e-5)
+ 297.2208145656899
+
+ CubicBezier and Arc also has a ``min_depth`` option that specifies the
+ minimum recursion depth. This is set to 5 by default, resulting in using a
+ minimum of 32 segments for the calculation. Setting it to 0 is a bad idea for
+ CubicBeziers, as they may become approximated to a straight line.
+
+ ``Line.length()`` and ``QuadraticBezier.length()`` also takes these
+ parameters, but they are ignored.
+
+ CubicBezier and QuadraticBezier also has ``is_smooth_from(previous)``
+ methods, that check if the segment is a "smooth" segment compared to the
+ given segment.
+
+ There is also a ``parse_path()`` function that will take an SVG path definition
+ and return a ``Path`` object.
+
+ >>> from svg.path import parse_path
+ >>> parse_path('M 100 100 L 300 100')
+ Path(Line(start=(100+100j), end=(300+100j)), closed=False)
+
+
+ Classes
+ .......
+
+ These are the SVG path segment classes. See the `SVG specifications
+ <http://www.w3.org/TR/SVG/paths.html>`_ for more information on what each
+ parameter means.
+
+ * ``Line(start, end)``
+
+ * ``Arc(start, radius, rotation, arc, sweep, end)``
+
+ * ``QuadraticBezier(start, control, end)``
+
+ * ``CubicBezier(start, control1, control2, end)``
+
+ In addition to that, there is the ``Path`` class, which is instantiated
+ with a sequence of path segments:
+
+ * ``Path(*segments)``
+
+ The ``Path`` class is a mutable sequence, so it behaves like a list.
+ You can add to it and replace path segments etc.
+
+ >>> path = Path(Line(100+100j,300+100j), Line(100+100j,300+100j))
+ >>> path.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> path[0] = Line(200+100j,300+100j)
+ >>> del path[1]
+
+ The path object also has a ``d()`` method that will return the
+ SVG representation of the Path segments.
+
+ >>> path.d()
+ 'M 200,100 L 300,100 Q 200,200 200,300'
+
+
+ Examples
+ ........
+
+ This SVG path example draws a triangle:
+
+
+ >>> path1 = parse_path('M 100 100 L 300 100 L 200 300 z')
+
+ You can format SVG paths in many different ways, all valid paths should be
+ accepted:
+
+ >>> path2 = parse_path('M100,100L300,100L200,300z')
+
+ And these paths should be equal:
+
+ >>> path1 == path2
+ True
+
+ You can also build a path from objects:
+
+ >>> path3 = Path(Line(100+100j,300+100j), Line(300+100j, 200+300j), Line(200+300j, 100+100j))
+
+ And it should again be equal to the first path:
+
+ >>> path1 == path2
+ True
+
+ Paths are mutable sequences, you can slice and append:
+
+ >>> path1.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> len(path1[2:]) == 2
+ True
+
+ Paths also have a ``closed`` property, which defines if the path should be
+ seen as a closed path or not.
+
+ >>> path = parse_path('M100,100L300,100L200,300z')
+ >>> path.closed
+ True
+
+ If you modify the path in such a way that it is no longer closeable, it will
+ not be closed.
+
+ >>> path[0].start = (100+150j)
+ >>> path.closed
+ False
+
+ However, a path previously set as closed will automatically close if it it
+ further modified to that it can be closed.
+
+ >>> path[-1].end = (300+100j)
+ >>> path.closed
+ True
+
+ Trying to set a Path to be closed if the end does not coincide with the start
+ of any segment will raise an error.
+
+ >>> path = parse_path('M100,100L300,100L200,300')
+ >>> path.closed = True
+ Traceback (most recent call last):
+ ...
+ ValueError: End does not coincide with a segment start.
+
+
+ Future features
+ ---------------
+
+ * Reversing paths. They should then reasonably be drawn "backwards" meaning each
+ path segment also needs to be reversed.
+
+ * Mathematical transformations might make sense.
+
+
+ Licence
+ -------
+
+ This module is under a MIT License.
+
+ Contributors
+ ============
+
+ Lennart Regebro <regebro at gmail.com>, Original Author
+
+ Justin Gruenberg implemented the Quadradic Bezier calculations and
+ provided suggestions and feedback about the d() function.
+
+ Michiel Schallig suggested calculating length by recursive straight-line
+ approximations, which enables you to choose between accuracy or speed.
+
+ Thanks also to bug fixers Martin R and abcjjy.
+
+ Changelog
+ =========
+
+ 2.0 (2015-05-15)
+ ----------------
+
+ - Nothing changed yet.
+
+
+ 2.0b1 (2014-11-06)
+ ------------------
+
+ - Added a Path.d() function to generate the Path's d attribute.
+
+ - Added is_smooth_from() on QubicBezier and QuadradicBezier.
+
+ - Path()'s now have a .closed property.
+
+ - Fixed the representation so it's parseable.
+
+ - The calculations for CubicBezier and Arc segments are now recursive,
+ and will end when a specific accuracy has been achieved.
+ This is somewhat faster for Arcs and somewhat slower for CubicBezier.
+ However, you can now specify an accuracy, so if you want faster but
+ looser calculations, you can have that.
+
+ - 't' segments (smooth, relative QuadraticBeziers) whose previous segment was
+ not a QuadraticBezier would get an incorrect control point.
+
+
+ 1.2 (2014-11-01)
+ ----------------
+
+ - New Quadradic Bezier implementation. [Justin Gruenberg]
+
+ - Solved issue #6: Z close path behavior. [abcjjy]
+
+
+ 1.1 (2013-10-19)
+ ----------------
+
+ - Floats with negative exponents work again.
+
+ - New tokenizer that is around 20 times faster.
+
+
+ 1.0 (2013-05-28)
+ ----------------
+
+ - Solved issue #2: Paths with negative values and no spaces didn't work.
+ [regebro]
+
+
+ 1.0b1 (2013-02-03)
+ ------------------
+
+ - Original release.
+
+
+Keywords: svg path maths
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.1
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Programming Language :: Python :: Implementation :: Jython
+Classifier: Topic :: Multimedia :: Graphics
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..8d30a96
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,165 @@
+svg.path
+========
+
+svg.path is a collection of objects that implement the different path
+commands in SVG, and a parser for SVG path definitions.
+
+
+Usage
+-----
+
+There are four path segment objects, ``Line``, ``Arc``, ``CubicBezier`` and
+``QuadraticBezier``.`There is also a ``Path`` object that acts as a
+collection of the path segment objects.
+
+All coordinate values for these classes are given as ``complex`` values,
+where the ``.real`` part represents the X coordinate, and the ``.imag`` part
+representes the Y coordinate.
+
+ >>> from svg.path import Path, Line, Arc, CubicBezier, QuadraticBezier
+
+All of these objects have a ``.point()`` function which will return the
+coordinates of a point on the path, where the point is given as a floating
+point value where ``0.0`` is the start of the path and ``1.0`` is end end.
+
+You can calculate the length of a Path or it's segments with the
+``.length()`` function. For CubicBezier and Arc segments this is done by
+geometric approximation and for this reason **may be very slow**. You can
+make it faster by passing in an ``error`` option to the method. If you
+don't pass in error, it defaults to ``1e-12``.
+
+ >>> CubicBezier(300+100j, 100+100j, 200+200j, 200+300j).length(error=1e-5)
+ 297.2208145656899
+
+CubicBezier and Arc also has a ``min_depth`` option that specifies the
+minimum recursion depth. This is set to 5 by default, resulting in using a
+minimum of 32 segments for the calculation. Setting it to 0 is a bad idea for
+CubicBeziers, as they may become approximated to a straight line.
+
+``Line.length()`` and ``QuadraticBezier.length()`` also takes these
+parameters, but they are ignored.
+
+CubicBezier and QuadraticBezier also has ``is_smooth_from(previous)``
+methods, that check if the segment is a "smooth" segment compared to the
+given segment.
+
+There is also a ``parse_path()`` function that will take an SVG path definition
+and return a ``Path`` object.
+
+ >>> from svg.path import parse_path
+ >>> parse_path('M 100 100 L 300 100')
+ Path(Line(start=(100+100j), end=(300+100j)), closed=False)
+
+
+Classes
+.......
+
+These are the SVG path segment classes. See the `SVG specifications
+<http://www.w3.org/TR/SVG/paths.html>`_ for more information on what each
+parameter means.
+
+* ``Line(start, end)``
+
+* ``Arc(start, radius, rotation, arc, sweep, end)``
+
+* ``QuadraticBezier(start, control, end)``
+
+* ``CubicBezier(start, control1, control2, end)``
+
+In addition to that, there is the ``Path`` class, which is instantiated
+with a sequence of path segments:
+
+* ``Path(*segments)``
+
+The ``Path`` class is a mutable sequence, so it behaves like a list.
+You can add to it and replace path segments etc.
+
+ >>> path = Path(Line(100+100j,300+100j), Line(100+100j,300+100j))
+ >>> path.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> path[0] = Line(200+100j,300+100j)
+ >>> del path[1]
+
+The path object also has a ``d()`` method that will return the
+SVG representation of the Path segments.
+
+ >>> path.d()
+ 'M 200,100 L 300,100 Q 200,200 200,300'
+
+
+Examples
+........
+
+This SVG path example draws a triangle:
+
+
+ >>> path1 = parse_path('M 100 100 L 300 100 L 200 300 z')
+
+You can format SVG paths in many different ways, all valid paths should be
+accepted:
+
+ >>> path2 = parse_path('M100,100L300,100L200,300z')
+
+And these paths should be equal:
+
+ >>> path1 == path2
+ True
+
+You can also build a path from objects:
+
+ >>> path3 = Path(Line(100+100j,300+100j), Line(300+100j, 200+300j), Line(200+300j, 100+100j))
+
+And it should again be equal to the first path:
+
+ >>> path1 == path2
+ True
+
+Paths are mutable sequences, you can slice and append:
+
+ >>> path1.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> len(path1[2:]) == 2
+ True
+
+Paths also have a ``closed`` property, which defines if the path should be
+seen as a closed path or not.
+
+ >>> path = parse_path('M100,100L300,100L200,300z')
+ >>> path.closed
+ True
+
+If you modify the path in such a way that it is no longer closeable, it will
+not be closed.
+
+ >>> path[0].start = (100+150j)
+ >>> path.closed
+ False
+
+However, a path previously set as closed will automatically close if it it
+further modified to that it can be closed.
+
+ >>> path[-1].end = (300+100j)
+ >>> path.closed
+ True
+
+Trying to set a Path to be closed if the end does not coincide with the start
+of any segment will raise an error.
+
+ >>> path = parse_path('M100,100L300,100L200,300')
+ >>> path.closed = True
+ Traceback (most recent call last):
+ ...
+ ValueError: End does not coincide with a segment start.
+
+
+Future features
+---------------
+
+* Reversing paths. They should then reasonably be drawn "backwards" meaning each
+ path segment also needs to be reversed.
+
+* Mathematical transformations might make sense.
+
+
+Licence
+-------
+
+This module is under a MIT License.
diff --git a/setup.cfg b/setup.cfg
new file mode 100644
index 0000000..18c00c1
--- /dev/null
+++ b/setup.cfg
@@ -0,0 +1,9 @@
+[pep8]
+max-line-length = 100
+ignore = E126,E127
+
+[egg_info]
+tag_build =
+tag_date = 0
+tag_svn_revision = 0
+
diff --git a/setup.py b/setup.py
new file mode 100644
index 0000000..5b4d0c7
--- /dev/null
+++ b/setup.py
@@ -0,0 +1,54 @@
+from setuptools import setup, find_packages
+import os
+
+version = '2.0'
+
+long_description = (
+ open('README.rst').read()
+ + '\n' +
+ 'Contributors\n'
+ '============\n'
+ + '\n' +
+ open('CONTRIBUTORS.txt').read()
+ + '\n' +
+ open('CHANGES.txt').read()
+ + '\n')
+
+setup(name='svg.path',
+ version=version,
+ description='SVG path objects and parser',
+ long_description=long_description,
+ # Get more strings from
+ # http://pypi.python.org/pypi?%3Aaction=list_classifiers
+ classifiers=[
+ 'Development Status :: 4 - Beta',
+ 'Intended Audience :: Developers',
+ 'License :: OSI Approved :: MIT License',
+ 'Operating System :: OS Independent',
+ 'Programming Language :: Python',
+ 'Programming Language :: Python :: 2.6',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3',
+ 'Programming Language :: Python :: 3.1',
+ 'Programming Language :: Python :: 3.2',
+ 'Programming Language :: Python :: 3.3',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Programming Language :: Python :: Implementation :: Jython',
+ 'Topic :: Multimedia :: Graphics'
+ ],
+ keywords='svg path maths',
+ author='Lennart Regebro',
+ author_email='regebro at gmail.com',
+ url='https://github.com/regebro/svg.path',
+ license='MIT',
+ packages=find_packages('src'),
+ package_dir={'': 'src'},
+ namespace_packages=['svg'],
+ include_package_data=True,
+ zip_safe=True,
+ install_requires=[
+ 'setuptools',
+ ],
+ test_suite='svg.path.tests',
+ )
diff --git a/src/svg.path.egg-info/PKG-INFO b/src/svg.path.egg-info/PKG-INFO
new file mode 100644
index 0000000..615b6a0
--- /dev/null
+++ b/src/svg.path.egg-info/PKG-INFO
@@ -0,0 +1,263 @@
+Metadata-Version: 1.1
+Name: svg.path
+Version: 2.0
+Summary: SVG path objects and parser
+Home-page: https://github.com/regebro/svg.path
+Author: Lennart Regebro
+Author-email: regebro at gmail.com
+License: MIT
+Description: svg.path
+ ========
+
+ svg.path is a collection of objects that implement the different path
+ commands in SVG, and a parser for SVG path definitions.
+
+
+ Usage
+ -----
+
+ There are four path segment objects, ``Line``, ``Arc``, ``CubicBezier`` and
+ ``QuadraticBezier``.`There is also a ``Path`` object that acts as a
+ collection of the path segment objects.
+
+ All coordinate values for these classes are given as ``complex`` values,
+ where the ``.real`` part represents the X coordinate, and the ``.imag`` part
+ representes the Y coordinate.
+
+ >>> from svg.path import Path, Line, Arc, CubicBezier, QuadraticBezier
+
+ All of these objects have a ``.point()`` function which will return the
+ coordinates of a point on the path, where the point is given as a floating
+ point value where ``0.0`` is the start of the path and ``1.0`` is end end.
+
+ You can calculate the length of a Path or it's segments with the
+ ``.length()`` function. For CubicBezier and Arc segments this is done by
+ geometric approximation and for this reason **may be very slow**. You can
+ make it faster by passing in an ``error`` option to the method. If you
+ don't pass in error, it defaults to ``1e-12``.
+
+ >>> CubicBezier(300+100j, 100+100j, 200+200j, 200+300j).length(error=1e-5)
+ 297.2208145656899
+
+ CubicBezier and Arc also has a ``min_depth`` option that specifies the
+ minimum recursion depth. This is set to 5 by default, resulting in using a
+ minimum of 32 segments for the calculation. Setting it to 0 is a bad idea for
+ CubicBeziers, as they may become approximated to a straight line.
+
+ ``Line.length()`` and ``QuadraticBezier.length()`` also takes these
+ parameters, but they are ignored.
+
+ CubicBezier and QuadraticBezier also has ``is_smooth_from(previous)``
+ methods, that check if the segment is a "smooth" segment compared to the
+ given segment.
+
+ There is also a ``parse_path()`` function that will take an SVG path definition
+ and return a ``Path`` object.
+
+ >>> from svg.path import parse_path
+ >>> parse_path('M 100 100 L 300 100')
+ Path(Line(start=(100+100j), end=(300+100j)), closed=False)
+
+
+ Classes
+ .......
+
+ These are the SVG path segment classes. See the `SVG specifications
+ <http://www.w3.org/TR/SVG/paths.html>`_ for more information on what each
+ parameter means.
+
+ * ``Line(start, end)``
+
+ * ``Arc(start, radius, rotation, arc, sweep, end)``
+
+ * ``QuadraticBezier(start, control, end)``
+
+ * ``CubicBezier(start, control1, control2, end)``
+
+ In addition to that, there is the ``Path`` class, which is instantiated
+ with a sequence of path segments:
+
+ * ``Path(*segments)``
+
+ The ``Path`` class is a mutable sequence, so it behaves like a list.
+ You can add to it and replace path segments etc.
+
+ >>> path = Path(Line(100+100j,300+100j), Line(100+100j,300+100j))
+ >>> path.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> path[0] = Line(200+100j,300+100j)
+ >>> del path[1]
+
+ The path object also has a ``d()`` method that will return the
+ SVG representation of the Path segments.
+
+ >>> path.d()
+ 'M 200,100 L 300,100 Q 200,200 200,300'
+
+
+ Examples
+ ........
+
+ This SVG path example draws a triangle:
+
+
+ >>> path1 = parse_path('M 100 100 L 300 100 L 200 300 z')
+
+ You can format SVG paths in many different ways, all valid paths should be
+ accepted:
+
+ >>> path2 = parse_path('M100,100L300,100L200,300z')
+
+ And these paths should be equal:
+
+ >>> path1 == path2
+ True
+
+ You can also build a path from objects:
+
+ >>> path3 = Path(Line(100+100j,300+100j), Line(300+100j, 200+300j), Line(200+300j, 100+100j))
+
+ And it should again be equal to the first path:
+
+ >>> path1 == path2
+ True
+
+ Paths are mutable sequences, you can slice and append:
+
+ >>> path1.append(QuadraticBezier(300+100j, 200+200j, 200+300j))
+ >>> len(path1[2:]) == 2
+ True
+
+ Paths also have a ``closed`` property, which defines if the path should be
+ seen as a closed path or not.
+
+ >>> path = parse_path('M100,100L300,100L200,300z')
+ >>> path.closed
+ True
+
+ If you modify the path in such a way that it is no longer closeable, it will
+ not be closed.
+
+ >>> path[0].start = (100+150j)
+ >>> path.closed
+ False
+
+ However, a path previously set as closed will automatically close if it it
+ further modified to that it can be closed.
+
+ >>> path[-1].end = (300+100j)
+ >>> path.closed
+ True
+
+ Trying to set a Path to be closed if the end does not coincide with the start
+ of any segment will raise an error.
+
+ >>> path = parse_path('M100,100L300,100L200,300')
+ >>> path.closed = True
+ Traceback (most recent call last):
+ ...
+ ValueError: End does not coincide with a segment start.
+
+
+ Future features
+ ---------------
+
+ * Reversing paths. They should then reasonably be drawn "backwards" meaning each
+ path segment also needs to be reversed.
+
+ * Mathematical transformations might make sense.
+
+
+ Licence
+ -------
+
+ This module is under a MIT License.
+
+ Contributors
+ ============
+
+ Lennart Regebro <regebro at gmail.com>, Original Author
+
+ Justin Gruenberg implemented the Quadradic Bezier calculations and
+ provided suggestions and feedback about the d() function.
+
+ Michiel Schallig suggested calculating length by recursive straight-line
+ approximations, which enables you to choose between accuracy or speed.
+
+ Thanks also to bug fixers Martin R and abcjjy.
+
+ Changelog
+ =========
+
+ 2.0 (2015-05-15)
+ ----------------
+
+ - Nothing changed yet.
+
+
+ 2.0b1 (2014-11-06)
+ ------------------
+
+ - Added a Path.d() function to generate the Path's d attribute.
+
+ - Added is_smooth_from() on QubicBezier and QuadradicBezier.
+
+ - Path()'s now have a .closed property.
+
+ - Fixed the representation so it's parseable.
+
+ - The calculations for CubicBezier and Arc segments are now recursive,
+ and will end when a specific accuracy has been achieved.
+ This is somewhat faster for Arcs and somewhat slower for CubicBezier.
+ However, you can now specify an accuracy, so if you want faster but
+ looser calculations, you can have that.
+
+ - 't' segments (smooth, relative QuadraticBeziers) whose previous segment was
+ not a QuadraticBezier would get an incorrect control point.
+
+
+ 1.2 (2014-11-01)
+ ----------------
+
+ - New Quadradic Bezier implementation. [Justin Gruenberg]
+
+ - Solved issue #6: Z close path behavior. [abcjjy]
+
+
+ 1.1 (2013-10-19)
+ ----------------
+
+ - Floats with negative exponents work again.
+
+ - New tokenizer that is around 20 times faster.
+
+
+ 1.0 (2013-05-28)
+ ----------------
+
+ - Solved issue #2: Paths with negative values and no spaces didn't work.
+ [regebro]
+
+
+ 1.0b1 (2013-02-03)
+ ------------------
+
+ - Original release.
+
+
+Keywords: svg path maths
+Platform: UNKNOWN
+Classifier: Development Status :: 4 - Beta
+Classifier: Intended Audience :: Developers
+Classifier: License :: OSI Approved :: MIT License
+Classifier: Operating System :: OS Independent
+Classifier: Programming Language :: Python
+Classifier: Programming Language :: Python :: 2.6
+Classifier: Programming Language :: Python :: 2.7
+Classifier: Programming Language :: Python :: 3
+Classifier: Programming Language :: Python :: 3.1
+Classifier: Programming Language :: Python :: 3.2
+Classifier: Programming Language :: Python :: 3.3
+Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: Implementation :: PyPy
+Classifier: Programming Language :: Python :: Implementation :: Jython
+Classifier: Topic :: Multimedia :: Graphics
diff --git a/src/svg.path.egg-info/SOURCES.txt b/src/svg.path.egg-info/SOURCES.txt
new file mode 100644
index 0000000..7177719
--- /dev/null
+++ b/src/svg.path.egg-info/SOURCES.txt
@@ -0,0 +1,24 @@
+CHANGES.txt
+CONTRIBUTORS.txt
+LICENSE.txt
+MANIFEST.in
+README.rst
+setup.cfg
+setup.py
+src/svg/__init__.py
+src/svg.path.egg-info/PKG-INFO
+src/svg.path.egg-info/SOURCES.txt
+src/svg.path.egg-info/dependency_links.txt
+src/svg.path.egg-info/namespace_packages.txt
+src/svg.path.egg-info/pbr.json
+src/svg.path.egg-info/requires.txt
+src/svg.path.egg-info/top_level.txt
+src/svg.path.egg-info/zip-safe
+src/svg/path/__init__.py
+src/svg/path/parser.py
+src/svg/path/path.py
+src/svg/path/tests/__init__.py
+src/svg/path/tests/test_doc.py
+src/svg/path/tests/test_generation.py
+src/svg/path/tests/test_parsing.py
+src/svg/path/tests/test_paths.py
\ No newline at end of file
diff --git a/src/svg.path.egg-info/dependency_links.txt b/src/svg.path.egg-info/dependency_links.txt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/src/svg.path.egg-info/dependency_links.txt
@@ -0,0 +1 @@
+
diff --git a/src/svg.path.egg-info/namespace_packages.txt b/src/svg.path.egg-info/namespace_packages.txt
new file mode 100644
index 0000000..05dd694
--- /dev/null
+++ b/src/svg.path.egg-info/namespace_packages.txt
@@ -0,0 +1 @@
+svg
diff --git a/src/svg.path.egg-info/pbr.json b/src/svg.path.egg-info/pbr.json
new file mode 100644
index 0000000..bde0efd
--- /dev/null
+++ b/src/svg.path.egg-info/pbr.json
@@ -0,0 +1 @@
+{"is_release": true, "git_version": "e921be7"}
\ No newline at end of file
diff --git a/src/svg.path.egg-info/requires.txt b/src/svg.path.egg-info/requires.txt
new file mode 100644
index 0000000..49fe098
--- /dev/null
+++ b/src/svg.path.egg-info/requires.txt
@@ -0,0 +1 @@
+setuptools
diff --git a/src/svg.path.egg-info/top_level.txt b/src/svg.path.egg-info/top_level.txt
new file mode 100644
index 0000000..05dd694
--- /dev/null
+++ b/src/svg.path.egg-info/top_level.txt
@@ -0,0 +1 @@
+svg
diff --git a/src/svg.path.egg-info/zip-safe b/src/svg.path.egg-info/zip-safe
new file mode 100644
index 0000000..8b13789
... 1389 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-svg.path.git
More information about the Python-modules-commits
mailing list