问题
Looking for a tool to convert something like
M10 20L0 0 5 5 10 10
from the absolute position to relative, something like:
M10 20l-10 -20 5 5 5 5
Notice the uppercase L for absolute and lowercase l for relative?
回答1:
Found a tool called Inkscape which allows saving to relative.
To do this:
- New document, create a random pencil path, and save the SVG. Close inkscape.
- Edit saved file in a text editor. Find and replace the pencil path with your path
- Re-open the document in Inkscape. Locate and move your path. Save.
- Edit the file again and look for the new relative path.
TADA
回答2:
- Open Inkscape and select, File, Inkscape Preferences (or Shift + Ctrl + P )
- Select SVG output
In the path data section untick Allow relative coordinates or select always use absolute coordinates depending on your version of inkscape.
This will only affect newly created paths, or existing objects for which a rewrite of the path data is triggered. For existing paths
Select Edit, then Select All in All Layers'.
- Use the arrow key to nudge the selection(e.g. one step up and one back down again). This will trigger a rewrite of the path data in 'd' which will follow the changed preferences for absolute path values.
This works for inkscape 0.48
回答3:
In settings, under "SVG Output", set "Path string format" to "Absolute" and save as plain SVG. You may have to nudge the object so Inkskape will reset the 'd' attribute for the path.
来源:https://stackoverflow.com/questions/6890685/is-there-a-tool-to-convert-svg-line-paths-from-absolute-to-relative