From b28ae6ec8d4667ac54084d252fb7cc937051b94f Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Wed, 29 Jul 2009 12:27:51 -0500 Subject: [PATCH] Remove trailing zeros from path coordinates. Use scientific notation in path coords if shorter. Scour polygon coordinates just like path coordinates. Added tests --- release-notes.html | 13 +++ scour.py | 96 +++++++++++++------ testscour.py | 33 +++++-- unittests/path-precision.svg | 3 +- unittests/path-truncate-zeros-calc.svg | 4 + ...ate-zeroes.svg => path-truncate-zeros.svg} | 0 unittests/path-use-scientific-notation.svg | 4 + unittests/polygon-coord.svg | 4 + unittests/polygon.svg | 1 + 9 files changed, 119 insertions(+), 39 deletions(-) create mode 100644 unittests/path-truncate-zeros-calc.svg rename unittests/{path-truncate-zeroes.svg => path-truncate-zeros.svg} (100%) create mode 100644 unittests/path-use-scientific-notation.svg create mode 100644 unittests/polygon-coord.svg diff --git a/release-notes.html b/release-notes.html index e6ea75a..b44eb46 100644 --- a/release-notes.html +++ b/release-notes.html @@ -9,6 +9,19 @@

Copyright 2009, Jeff Schiller

+
+
+

Version 0.16

+
+

July 29th, 2009

+ +
+

Version 0.15

diff --git a/scour.py b/scour.py index aab3244..1681751 100755 --- a/scour.py +++ b/scour.py @@ -39,10 +39,14 @@ # Next Up: # + add option to keep inkscape, adobe, sodipodi elements and attributes -# - ensure a really good understanding of prec vs. quantize and what I want --set-precision to do +# + if any path coordinate has decimal places, remove any trailing zeros +# + use scientific notation is shorter in path coordinates +# + scour polygon coordinates just like path coordinates +# - scour polyline coordinates just like path coordinates +# - if after reducing precision we have duplicate path segments, then remove the duplicates and +# leave it as a straight line segment # - enable the precision argument to affect all numbers: polygon points, lengths, coordinates # - remove id if it matches the Inkscape-style of IDs (also provide a switch to disable this) -# - convert polygons/polylines to path? (actually the change in semantics may not be worth the marginal savings) # - prevent elements from being stripped if they are referenced in a