From e163fb348c64b1abcb4cf5ae202bbda250fe3c96 Mon Sep 17 00:00:00 2001 From: JSCHILL1 Date: Thu, 21 May 2009 21:32:44 -0500 Subject: [PATCH] Implemented converted straight curves into lines. Remove last point from polygon data if possible --- release-notes.html | 12 +++ scour.py | 190 +++++++++++++++++++++++++++-------- testscour.py | 20 +++- unittests/polygon.svg | 4 + unittests/straight-curve.svg | 3 + 5 files changed, 188 insertions(+), 41 deletions(-) create mode 100644 unittests/polygon.svg create mode 100644 unittests/straight-curve.svg diff --git a/release-notes.html b/release-notes.html index 12ab627..3e6d8f7 100644 --- a/release-notes.html +++ b/release-notes.html @@ -9,6 +9,18 @@

Copyright 2009, Jeff Schiller

+
+
+

Version 0.14

+
+ + +
+

Version 0.13

diff --git a/scour.py b/scour.py index a7affe5..c45fc45 100755 --- a/scour.py +++ b/scour.py @@ -27,25 +27,25 @@ # Yet more ideas here: http://wiki.inkscape.org/wiki/index.php/Save_Cleaned_SVG # TODO: Adapt this script into an Inkscape python plugin # -# * Specify a limit to the precision of all positional elements. # * Clean up Definitions # * Collapse duplicate gradient definitions # * Clean up paths # * Eliminate last segment in a polygon -# * Collapse straight curves. # * Process Transformations # * Process quadratic Bezier curves # * Collapse all group based transformations # Suggestion from Richard Hutch: # * Put id attributes first in the serialization (or make the d attribute last) -# This would require my own serialization fo the DOM objects +# This would require my own serialization fo the DOM objects (not impossible) # Next Up: # + fix bug with consecutive path coordinates not being translated properly to relative commands -# - eliminate last segment in a polygon -# - collapse straight curves +# + convert straight curves to lines +# + eliminate last segment in a polygon +# - provide command-line option to disable raster-to-base64 conversion # - 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