Commit Graph

71 Commits (security-update)

Author SHA1 Message Date
Andrew Port 67fd6e885d remove error-causing type check 2021-10-18 22:36:24 -07:00
Andrew Port 2422d15251 update 2021-10-18 21:24:36 -07:00
Andrew Port e4c7b53f62 fix text name 2021-09-26 18:17:58 -07:00
Andrew Port 73e0ae2b21 temporarily disable problemsome hash test 2021-09-23 04:02:51 -07:00
Andrew Port 8b8ac6c9fe fix issue with test failing due to hash builtin changing in python 3.2 then again in 3.8 2021-09-23 03:52:16 -07:00
Andrew Port 44d08b6737 fix issue with test failing due to hash builtin changing in python 3.8 2021-09-23 03:15:26 -07:00
Andrew Port 657a9d6745 updated from master 2021-09-23 00:22:55 -07:00
Andrew Port 3e1f8e00a5 minor cleanup 2021-09-23 00:21:41 -07:00
Andrew Port b8f4e71f5b remove accidentally committed debugging code 2021-09-23 00:18:03 -07:00
Andrew Port 1b503a7b2f fix test that failed in python2 due to changes to hash builtin 2021-09-23 00:15:37 -07:00
Andrew Port e0f212a334 make paths and path semgents hashable 2021-09-22 21:19:13 -07:00
Andrew Port a2b62fc011 add docstring 2021-09-21 02:40:35 -07:00
Andrew Port d2b1ea5770 make imports explicit 2021-09-21 02:22:12 -07:00
Andrew Port 0a31f348d6 remove warning 2021-09-21 01:54:25 -07:00
Andrew Port 9863e7050a add python2 compatible warning check for closed property 2021-09-21 01:54:11 -07:00
Andrew Port ace8522c19 fix most linter warnings in test_path.py 2021-09-20 23:41:15 -07:00
Andrew Port d881b21b47 remove unused import 2021-09-20 22:40:38 -07:00
Andrew Port 8dc12d4efc add delta tolerance to all assertAlmostEquals that don't have one 2021-06-27 22:30:56 -07:00
tatarize 3a1fe8695d
Bug Corrections. Closes #113, #95, #94, and #71 (#136)
* Closes #113

Previous fix stopped working because numpy is more liberal dividing by zero and returning nan values.

* Closes #71

* Closes #95

* Closes #94
2021-01-16 20:08:58 -08:00
Andrew Port 561c89ad47 fix fail test (test assumed untrue number of intersections) 2020-12-08 18:45:35 -08:00
Andrew Port ee58270f66 fix incorrectly written assertTrue tests 2020-12-08 18:38:51 -08:00
Andrew Port 30f517e735 fix Arc.center being nan cause of switch to np.sqrt raising different error than math.sqrt 2020-12-08 18:21:24 -08:00
tatarize b3d9544624
Approximate Arcs With Beziers (#130)
* Approximate Arcs With Beziers

* Quadratic in documentation.

* Test Coverage, approximate arcs.
2020-12-01 18:37:15 -08:00
tatarize 0c9dd318aa
Fix Issue #99 + Test Coverage. (#115) 2020-07-16 17:51:07 -07:00
Andy Port 22f3dafe87 remove unused numpy import 2020-07-06 17:21:29 -07:00
Andy Port 945ae49967 fixed test_group_flatten for document.py changes 2020-07-06 11:13:47 -07:00
tatarize 90dfeb7b13
Move Path Parsing into Path. (#114) 2020-07-06 11:01:15 -07:00
Andy Port c89c68f421 speed up randialrange for Line objects 2020-07-01 22:31:57 -07:00
Andy Port 1f7503aabd some renames and add __repr__ and pretty() 2020-06-23 21:54:58 -07:00
Andy Port 445899b2eb renamed Document.flatten_all_paths to flattened_paths 2020-06-23 20:54:27 -07:00
Sebastian Kuzminsky 685f9a6eaf
fix Arc/Arc intersections (#110)
* add some failing Arc.intersect(Arc) tests

* implementing Arc.intersect(Arc)

This commit adds special handling in Arc.intersect() when the other
segment is an Arc, and when both segments are circular and non-rotated.

This particular case is common, and quick and easy to solve algebraically.

This commit fixes the failing tests added in the previous commit.
2020-06-19 19:40:38 -07:00
David Romero 90f8f76185
Method for checking if one path is inside another path (#105)
* Added method is_contained_by to the Path class

* Adding a requirements.txt file

Signed-off-by: David Romero <dromero.fisica@gmail.com>

* Correcting tests of is_contained_by
2020-06-19 19:36:22 -07:00
Grey f99f9d6bb3
Support flattening paths of only nested groups (#88)
* Fixed document.flatten_group(~) for nested groups and added a test

* Add space for PEP8 conformance

* Add documentation for document.get_group()

* Use group_search_xpath to be consistent and customizable

* Fix lexical mistake in comments

* Fix grammar mistake in comments
2020-06-19 18:59:47 -07:00
Sebastian Kuzminsky 2eb8fb62ed
test: show arguments that failed, to aid debugging (#83) 2020-06-19 18:47:04 -07:00
taoari c7b6c030a6
relative path support (#81)
* relative path support

* add test for path.d(rel=True)

* add path test to test_path.py
2020-06-19 18:43:29 -07:00
Sebastian Kuzminsky b37e74f5f3 Update Path.area to work with Arc segments (#65)
* add some tests of Path.area()

These tests currently fail because area() doesn't deal with Arc segments.
Fix in the following commit.

* make Path.area() approximate arcs

Fixes #37.

* Path.area(): fixup tabs/spaces for python3

* added asin to imports

* added asin to imports

* minor improvements to style, performance, and docstring
2018-11-04 21:40:56 -08:00
tatarize e91a35c3da Basic Svg_Io_Sax (#66)
* Basic Svg_Io_Sax

* Update to binary write

* Fixed SaxSvg Load, tweaked test.

* Couple tweaks.

* Couple tweaks to fit the dom parser api better

* Switch to iterparse for speed

* Used None matrix for identity in default case.

* Test Update for None Matrix
2018-11-04 21:07:40 -08:00
Sebastian Kuzminsky 2feb3c92b5 Arc line intersect, 3rd try (#64)
* add Line.point_to_t() and tests

These tests don't print anything while they run, and they use use the
assert() helpers from the unittest module.

* add Arc.point_to_t() and tests

These tests don't print anything while they run, and they use use the
assert() helpers from the unittest module.

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

These tests don't print anything while they run, and they use use the
assert() helpers from the unittest module where possible.

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-11-04 20:55:17 -08:00
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