Commit Graph

86 Commits (a50c522f869467df6915fb53e2f5aa5886347776)

Author SHA1 Message Date
Andy Port a50c522f86
use np.close to check to check for vanishing denom
Just to offer users some amount of control over the tolerance.
2018-02-27 22:38:01 -08:00
Sebastian Kuzminsky 89d9acf06e Line.intersect(Line): fix a "miss some intersections" bug
Negative numbers are allowed in the denominator, what we really want to
avoid is near-zero denominators.
2018-01-20 20:46:54 -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 fc34d2c4cf deal with float rounding error in Line.intersect(Line)
This commit fixes #41.

In the test case added in the previous commit, two non-intersecting lines
are very nearly collinear, but float rounding errors lead to incorrect
intersections reported.

This commit makes Line.intersect() treat denominators below 1e-9 as 0,
to make it more accepting of float rounding.
2018-01-06 23:15:43 -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
Andy Port 50d7db0352
Merge pull request #31 from andersgb/acos-roundoff-fix
Arc parsing round-off fix
2017-12-25 23:55:26 -05:00
Andy Port c32c7a627b
Merge pull request #34 from SebKuzminsky/fixup-offset-example
README: fix a type error in Offseting Paths example
2017-12-23 02:51:50 -08:00
Sebastian Kuzminsky 2a456b168d README: remove dead code from Offsetting Paths example 2017-12-18 08:22:40 -07:00
Sebastian Kuzminsky 8c93eb0f2f README: fix a type error in Offseting Paths example
Before this commit the `t = k / steps` math is done with integers,
which always results in `t = 0`.

This commit forces the math to be done with floating-point numbers,
which results in the progression of `t` values we want.
2017-12-18 00:07:26 -07:00
Andy b54bf778b4 changed version number in preparation for PyPI update 2017-11-27 15:27:25 -08:00
Andy Port 1f074d5adc
changed setup to auto-install svgwrite + numpy 2017-11-27 15:17:29 -08:00
Anders Granskogen Bjørnstad ec63d0c312 Arc: Handle round-off issue with acos()
math.acos raises outside of valid range [-1, 1]. Handle round-off errors
gracefully by using `round()` here too.
2017-11-10 13:44:24 +01: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 Port 5d65d575b5 Merge pull request #25 from mathandy/svgwrite-debug-false-by-default
now disvg and wsvg pass `debug=False` into svgwrite.Drawing() by default
2017-07-22 15:04:56 -07:00
Andy 586bccd0f2 now svgwrite debug is false by default 2017-07-18 20:01:37 -07:00
Andy Port f9229ca9bf minor change 2017-07-18 18:36:36 -07:00
Andy 5b1d0dc9cd added CONTRIBUTION.md -- guidelines for contributors 2017-07-18 18:33:00 -07: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
Andy 38eeac858c fixed support for rectangles when no x,y attributes are specified
defaults to 0,0
2017-04-26 02:21:01 -07:00
Andy d670547149 added polygon() and polyline() to __init__ 2017-04-26 02:20:11 -07:00
Andy a094f92b3a added polyline and polygon functions (points --> Path of Line objects) 2017-04-26 01:54:44 -07:00
Andy a3a529899c added rect element support to svg2paths 2017-04-26 01:53:34 -07:00
Andy 1d1bec1877 add ellipse/circle option to svg2paths2 and change return_svg_attributes to be second argument. 2017-04-23 01:14:59 -07:00
Andy aa02116e87 prettify svg2paths docstring (Google style) 2017-04-23 01:12:12 -07:00
Andy 900d5ba93b fixed typo and long line in docstrings 2017-04-23 00:45:41 -07:00
Andy Port 9a1b1ff1e5 Merge pull request #21 from jpcofr/ellipse_d_squashed
Added functionality to extract circle and ellipse elements from SVG files.  Circles and ellipses are treated as paths of two `Arc` objects.
2017-04-23 00:33:06 -07:00
Juan Pablo Contreras Franco cf91c95724 Merge 2017-04-23 07:53:10 +02:00
Juan Pablo Contreras Franco 216965e6ab Corrected wrongly deleted docstring line 2017-04-23 07:50:43 +02:00
Juan Pablo Contreras Franco 7b4bd38b21 Small syntax error in the docstring. 2017-04-23 07:38:24 +02:00
Andy Port 977914528c Merge pull request #18 from derVedro/patch-5
fixed ignored height and width arguments (specified using svg_attributes argument in disvg/wsvg)
2017-04-20 20:34:59 -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 Port d8dfbd01fc changed default (when svg_attributes doesn't have a height/width) to the szx and szy constructed from path bounding boxes
@DerVedro was there a reason you thought the default should be 100% (beyond that being the current behavior -- which I see as a bug)?
2017-04-06 16:05:28 -07:00
derVedro 88185419f5 fliped width and height
the x and y were swaped by my mistake
2017-03-31 00:26:02 +02:00
derVedro f72987d69b fixed ignored height and width arguments
issue #17 fix
2017-03-31 00:17:59 +02:00
Andy 7be111bba8 fix new README example whitespace 2017-03-30 03:06:36 -07:00
Andy 3ad65aa3c5 added example to README plus minor changed
example regarding computing many points quickly with numpy arrays
2017-03-30 02:55:40 -07:00
Andy dcd4896fd6 added "examples" folder 2017-03-30 02:22:23 -07:00
Andy 385dbb7196 cleanup
removed commented-out “pathless_svg” functionality
2017-03-30 01:57:23 -07: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 b019e30efd rebuild for 1.3.1 release
note: 1.3 was never published (contained builtins imports)
2017-02-28 23:41:38 -08:00
Andy 6921c147cd build for 1.3 release 2017-02-28 23:38:19 -08:00
Andy 1655b77d15 removed builtins imports 2017-02-28 23:34:29 -08:00
Andy 465e96f8c8 for PyPI v1.3 update 2017-02-28 23:11:46 -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