/usr/lib/python3/dist-packages/svg.path-2.1.1.egg-info/PKG-INFO is in python3-svg.path 2.1.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | Metadata-Version: 1.1
Name: svg.path
Version: 2.1.1
Summary: SVG path objects and parser
Home-page: https://github.com/regebro/svg.path
Author: Lennart Regebro
Author-email: regebro@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@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.
Steve Schwarz added an error argument to make that choice an argument.
Thanks also to bug fixers Martin R, abcjjy, Daniel Stender and MTician.
Changelog
=========
2.1.1 (2016-02-28)
------------------
- #18: QuadraticBeziers could get a DivideByZero error under certain
circumstances. [MTician]
- Accept an error parameter to Path.point() to be able to
control error vs performance setting. [saschwarz]
- #25: Arc's could create a MathDomain error under certain circumstances.
- #17: Set last_command always.
2.0.1 (2015-10-17)
------------------
- #20: The doctext for the closed() setter was incorrect.
- #19: Fixed so tests didn't use relative paths. [danstender]
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 :: 3.5
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Programming Language :: Python :: Implementation :: Jython
Classifier: Topic :: Multimedia :: Graphics
|