Combining paths can create infinitesimally small coordinate numbers

Bug #1190808 reported by Geoff Adams
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Undecided
Unassigned

Bug Description

I have a reasonably simple SVG file with two paths. One of the paths contains a coordinate with fairly small values (0.0001,0.077). I then combine the two paths together, and Inkscape generates a combined path with very small values with unnecessarily high precision: -5.9211895e-16 6.46875.

I understand that the math may produce exactly these numbers, but is there any use to such precise, small numbers? It's hard to imagine the magnification that would be required to distinguish -5.9211895e-16 from 0, much less from -5.9211896e-16, and the precision of these numbers is substantially higher than the two significant digits in the input. To the precision of the input coordinates, that number is 0.

Worse for my use, the SVG parser I'm using is unable to handle the exponentiation syntax, so I have to convert these numbers manually to 0. (I know, that's not Inkscape's problem, since the spec allows this. But I do wonder how widespread this is.) It would be nice if Inkscape would limit the output precision to not much more than the input precision to avoid these problems.

It's also interesting that Inkscape rewrites the 0.0001 to 10e-4 when saving, but leaves 0.0077 as 0.0077.

The original and unioned-path SVG files can be found here:
    http://www.avernus.com/~gadams/dingbats/two-paths.svg
    http://www.avernus.com/~gadams/dingbats/two-paths-unioned.svg

su_v (suv-lp)
tags: added: boolops precision
Revision history for this message
su_v (suv-lp) wrote :

Geoff Adams wrote:
> I then combine the two paths together, (…)
and
> The original and unioned-path SVG files can be found (…)

Could you please clarify which path operation was actually used? ('Path > Combine' and 'Path > Union' are not the same).

Please also provide information about your OS/platform and Inkscape version (see Inkscape menu 'Help > About Inkscape').

Revision history for this message
Geoff Adams (gsadams) wrote :

> Could you please clarify which path operation was actually used? ('Path > Combine' and 'Path > Union' are not the same).

Yes, I should have been more clear. Both the Combine (Ctrl-K) and Union (Ctrl-+) operations create similar coordinates. I actually need the Union result, so that's what I've included. (Since the filename was misleading, I've changed it and updated the URL in my original report.)

I'm using Inkscape 0.48.3.1 r9886 on Ubuntu 12.04 LTS (Precise).

Geoff Adams (gsadams)
description: updated
Revision history for this message
Beluga (buovjaga) wrote :

The most high precision I got after Combine is: -0.363 7.5557065,-2.9667478 0.7349985,-3.1119408

With Union I do see -5.9211895e-16 6.46875 inside the file.

Arch Linux 64-bit, KDE Plasma 5
Inkscape 0.92+devel 15099 (GTK3)

Changed in inkscape:
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.