-----Original Message----- From: inkscape-devel-bounces@lists.sourceforge.net [mailto:inkscape-devel-bounces@lists.sourceforge.net] On Behalf Of Bob Jamison Sent: maandag 1 september 2008 23:29 To: Jon A. Cruz; inkscape Subject: Re: [Inkscape-devel] Win32 nightly builds don't work since Aug 16
Jon A. Cruz wrote:
On Sep 1, 2008, at 5:05 AM, J.B.C.Engelen@...1578... mailto:J.B.C.Engelen@...1578... wrote:
I disagree. In the case of paths, the current curve's
final point is
exactly the same data as the next curve's initial point. 2geom has this
built-in redundancy in path data because it simplifies
things a lot.
But
it is important to maintain this data duplication. Therefore, these
points should be exactly (binary) equivalent.
Yes, but the main problem with floating point values is that
depending on
the rounding involved on calculations to get to some value,
things may
be equivalent but not an exact match for all bits.
Also keep in mind that precision might vary from platform
to platform. Jon,
I was thinking of that just now. Someone could load a perfectly valid svg file with a different opinion of floats than Inkscape, and Inkscape will abort and commit suicide because of it. Overreaction, yes, but software is irrational. :-)
Maybe my explanation was unclear. Let me try again :-) Loading the following SVG:
M 2.2,3.4 L 4.567,2 L 5,6
is currently stored in Inkscape/2geom as:
(start path) linesegment from (2.2 , 3.4) to (4.567, 2) linesegment from (4.567, 2 ) to ( 5 , 6)
regardless of the precision of your pc. If you have a pc with fixed point math and 1 decimal, it'd be:
linesegment from (2.2, 3.4) to (4.5, 2) linesegment from (4.5, 2 ) to ( 5, 6)
Nothing will bug as 4.5==4.5 binary equivalent.
Now a transform matrix is applied. 2geom must apply the same math to the end points. Because the start values are identical, so will the result. If not, that's a 2geom bug.
A very important 2geom principle I've come to appreciate is 'correctness' above all. And I think it is very much correct to have binary equivalent end points. (although it might be nice to have a method that smooths/corrects a wrong/discontinuous path that is generated by a user; boolops creates such paths that are stitched together now)
Hope this helps, Johan
(hope this mail discussion is read and checked by 2geom gurus!)