Commit Graph

33 Commits (9e218b2b3bb05e047efaadd5e50431a7b212c169)

Author SHA1 Message Date
Andy Port 165372562e
Revert "Arc line intersect, take 2 (#60)" (#63)
This reverts commit 2da39e4c02.
2018-08-22 00:27:55 -07:00
Sebastian Kuzminsky 2da39e4c02 Arc line intersect, take 2 (#60)
* add Line.point_to_t() and tests

* add Arc.point_to_t() and tests

* add a bunch of failing arc/line intersection tests

This commit contains a bunch of failing arc/line intersections that I
and other people have run into.

All these tests are fixed in the following commit.

* better implementation of Arc.intersect(Line)

Fixes mathandy/svgpathtools#35.

This commit fixes all the arc/line intersection test cases added in the
previous commit.

This implementation provides special handling in Arc.intersect() when
`self` is a non-rotated Arc and `other_seg` is a Line.  In this case
it uses the straight-forward closed-form solution to identify the
intersection points.

Rotated Arcs and Arcs intersecting with non-Line objects still use
the pre-existing intersection code, that part is totally untouched by
this commit.
2018-08-22 00:19:05 -07:00
Andy Port 7ebc56a831 aesthetic cleanup 2018-08-21 20:54:02 -07:00
Andy Port 40a515ee63 removed all np.matrix uses (deprecation) 2018-08-21 20:05:59 -07:00
Michael X. Grey 360d6b224c Flattening SVG groups and handling transforms (#55)
* Some progress (and added CONTRIBUTING.md)

* fixed documentation line-width to be PEP 8 compliant

* fixed documentation line-width to be PEP 8 compliant

* style changes

* made some design changes

* Make the Document class available when importing the library

* Add a method to parse transform strings

* Iterate on the implementation of the Document class

* Tweaks to transform parsing implementation

* Implementing a depth-first flattening of groups

* Finish implementation of flatten_paths

* Beginning to write tests for groups

* Refactoring flatten_paths() into flatten_all_paths()

* Clean up implementation of document classes

* Debugging xml namespace behavior -- needs improvement

* Improve the way the svg namespace is handled

* Print out some paths to see that they're sane

* Fix multiplication of numpy matrices -- need to use .dot() instead of operator*

* Create a unit test for parsing SVG groups

* Return a reference to an element instead of a copied dictionary of attributes

* Add a test for <path> elements that contain a 'transform' attribute

* minor docstring improvements

* got rid of svg2path changes (reverted to master)

* updated to match master

* Remove accidental paranthesis

* Remove unnecessary import

* Use a default width and height of 0, as dictated by SVG specs, in case width or height is missing

* Expose the CONVERSIONS and CONVERT_ONLY_PATHS constants

* Fix the use of some numpy operations

* Remove untested functions

* Fix add_group() and write tests for adding groups and paths

* Update documentation of document module

* Add tests for parsing transforms

* Update the module name for svg_to_paths

* Improve Python3 compatibility

* Try to improve compatibility

* More tweaks for compatibility
2018-08-21 18:00:29 -07:00
Andy 7fc7e45113 fixed false error raised when scipy not installed 2018-07-09 21:40:00 -04:00
Andy fb916596e2 fixed scale 2018-07-06 23:00:25 -04:00
Andy fd521748fa fixed scaled (before cleanup) 2018-07-06 22:59:28 -04:00
Andy fd95b5609f partially fixed scale fcn and improved tests 2018-06-08 22:13:18 -07:00
Andy Port 55661d18a4
Merge pull request #54 from playi/scale
add scale() for curves, and scaled() for paths
2018-05-30 21:20:22 -07:00
Andy Port 304c0bbe1d
improved `scale` related tests 2018-05-30 19:30:24 -07:00
Orion Elenzil ee656c7de0 refactor `scale()` and `scaled()` to `scale_uniform()` and `scaled_uniform()` 2018-05-30 10:54:56 -07:00
Dmitry_Milk 321e097a4e polygon/polyline parsing tests added 2018-05-27 12:34:12 +03:00
Andy Port eafe3682b9
altered so lines aren't (much) over 79 characters
Note: this is mostly unrelated to changes requested by @playi
2018-05-22 19:34:56 -07:00
Andy Port 6394415108
minor aesthetic change 2018-05-22 19:22:09 -07:00
Orion Elenzil 1ba9d45b35 unit test for new scale() and scaled() path transformation. tests all current segment types, composite paths, etc 2018-05-22 15:48:45 -07:00
Sebastian Kuzminsky cc4573ffc7 add a failing Line.intersect(Line) test
I introduced this bug recently, sorry!  The bug is fixed in the following
commit.
2018-01-20 20:45:47 -07:00
Sebastian Kuzminsky de600f9b91 rename test to make room for more 2018-01-20 20:36:06 -07:00
Sebastian Kuzminsky 847b270bc2 add a failing Line.intersect(Line) test
These two lines are parallel but do not intersect.  Line.intersect()
finds an incorrect intersection.
2018-01-06 23:05:55 -07:00
Andy bf95944c49 moved test for checking if `Arc()` throws `acos` domain error due to numerical error 2017-12-26 00:57:48 -05:00
Anders Granskogen Bjørnstad 316dc8bfe9 test_parsing.py: Add test_roundoff example
This test currently fails due to math.acos(1.0000000000001) raising a
ValueError.
2017-11-10 13:43:39 +01:00
Andy e8367d463a added svg (planning to make unittest in future)
TODO: create unittest for rect element support
2017-04-26 02:21:43 -07:00
Juan Pablo Contreras 2a24cf640d Added functionality to process both circles and ellipses.
Added tests related to the functionality.
2017-04-07 09:44:04 +02:00
Andy 60d67923b6 fix issue#15 Path.cropped() bug, and more
-also fixed <path>.cropped(1, 0) bug (now raises AssertionError)
-also now Path.cropped() raises AssertionError if given negative values
2017-03-30 01:38:27 -07:00
Andy 4ec69a4cff remove empty `pathtools.py` and move tests from `test_pathtools.py` to `test_path.py` 2017-03-24 00:18:22 -07:00
Andy 9423f5fdc3 fixed svg2path parsing of svg-polygon elements with redundant closure points 2017-03-16 01:58:48 -07:00
Andy 1655b77d15 removed builtins imports 2017-02-28 23:34:29 -08:00
Andy 8815ddcd52 futurized for Python 3 compatibility
and some other minor changes of no effect
2017-02-28 23:04:37 -08:00
Andy f697a91190 fixed higher order Bezier to polynomial conversion 2017-02-28 20:41:35 -08:00
Andy 0cf57d4276 label swap/fix -- no effect 2017-02-28 18:29:19 -08:00
Andy 19841906f7 added some unittests for the .intersect() methods 2017-02-20 22:57:59 -08:00
Andy fcdb61c39e minor change to in-line comments
Note only is this true of tests left from svg.path but also those
written by me.
2017-02-20 17:21:53 -08:00
Andy 08e8dc71ff improve distribution to PyPI
Now svg files, readme, unit tests, and license included in PyPI dis
2016-10-29 00:35:51 -07:00