SVG vector relative to absolute coordinates

Discuss SVG code, accessible via the XML Editor.
frpr
Posts: 4
Joined: Tue Nov 09, 2010 5:40 am

SVG vector relative to absolute coordinates

Postby frpr » Thu Dec 29, 2011 11:31 pm

Hello,
I need to convert a simple SVG vector image with bezier paths from relative to
absolute coordinates.
So it uses big "C" instead of little "c"

Code: Select all

 id="path3"  d="M 47,200 C 47,200 27,140 47,120


Can I do this with Inkscape or could you please recommend any other tool?
I want to use the absolute coordinates SVG image in other program that cannot compile relative units (SWFC compiler).
Someone else have same similiar problem here: http://inkscape-forum.andreas-s.net/topic/204884

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: SVG vector relative to absolute coordinates

Postby ~suv » Fri Dec 30, 2011 2:27 am

Yes, you can do it in Inkscape. But please do keep in mind if you simple copy the path data from a 'random' object in an Inkscape file, that there might be transforms on parent groups and/or layers (svg groups with a special attribute in Inkscape's namespace), which will affect the real absolute position as well [1].

How to convert relative to absolute coordinates:
  1. Change the preferences for 'SVG Output > Path Data' to always use absolute coordinates (i.e. do not allow relative coordinates). This will only affect newly created paths, or existing objects for which a rewrite of the path data is triggered.
  2. For existing paths, use 'Edit > Select All in All Layers', and nudge the selection with the arrow keys (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 optimized path data.

[1] To flatten transforms (on objects as well as parent svg containers like groups): see e.g. Subject: Re: Simplify inkscape transforms. For transforms added to top-level layers after changing the dimensions of the page, add a new layer and move the objects onto the new layer (see menu 'Layer').

frpr
Posts: 4
Joined: Tue Nov 09, 2010 5:40 am

Re: SVG vector relative to absolute coordinates

Postby frpr » Fri Dec 30, 2011 3:57 am

Exactly what I needed. The problem is solved. Thank you.


Return to “SVG / XML Code”