On 22-06-11 21:32, Adrian Dusa wrote:
On Wed, Jun 22, 2011 at 18:01, Jasper van de Gronde <th.v.d.gronde@...226...> wrote:
...
- indeed, many times I get values like "113.000006" (in which case I am
manually editing my path -- counterproductive) or perhaps even more confusing values such as "4.35838e-5"... which is practically equal to zero.
Without knowing exactly how such values are produced it is hard to tell where the problem lies, but such values are not uncommon, nor unexpected. Basically there is no way for Inkscape to know that you did not actually mean to have such values.
Oh, that's very simple: in my case, I get these values when snapping to grid. Simply, I take a path away from its fixed coordinates, then move it back with snap to grid... my impression was that snapping makes the coordinates exact, but I might not understand very well how it works.
This is interesting. I just did a quick test, and you might be on to something here. I'll take a closer look asap, but you may want to file a bug, including the steps you use to reproduce it at: http://bugs.launchpad.net/inkscape/ That way it won't be forgotten and we can easily track what's happening with this particular bug.
The reason for which I need the shortest possible string is to use it in a webpage via Javascript code. As the number of objects tends to increase as the webpage gets more and more complicated, I am concerned with loading time.
Then in your case I would recommend NOT forcing all coordinates to be relative, and I would definitely not force it to repeat commands, as both (can) make the path data longer. In principle Inkscape's output should be optimal, if it isn't it's a bug. That is, given a certain path Inkscape will give the smallest path string representing that path upto the specified numerical precision (without resorting to some tricks that make the output extremely hard to read).