Not all polygon's nodes touch ellipse's path

Bug #1354211 reported by Brian
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

(ALL MEASUREMENTS IN INCHES) *Running version 0 . 48 . 5 of inkscape* **running windows 7 home premium 64 bit**

I created 2 objects:

A polygon with 6 corners / Width 8.000 / Height 6.928

An ellipse with Width 8.000 / Height 8.000

I centered the ellipse on top of the 6 sided polygon and noticed something strange. All the nodes should touch the

path of the ellipse due to equal radii. I zoomed in on the 2 nodes on the left and right, they touch the ellipse no

problem. When i zoomed in on the other nodes (noting they are at 60 degrees, whereas the 2 nodes touching are on

the 0/180/360 degree line) they do not touch and are off by about .001 or so (hard to get an accurate measure of

deviance). After running a test with just the ellipse and using a straight line path equal to the width of the ellipse

and duplicating and rotating every 30 degrees I found that unless the nodes are at 0,90,180,270, and/or 360 degrees

they do not touch the path. I don't know if this has something to do with only 3 decimal places (0.000) or what.

this is part of a design for an art project. thanks in advance. hope to hear from someone soon.

Tags: precision
Revision history for this message
Alvin Penner (apenner) wrote :

could you attach a demo svg file?
normally the agreement should be best at multiples of 45 degrees, and worst at odd multiples of 22.5 degrees.

Revision history for this message
Alvin Penner (apenner) wrote :

related to Bug 997571 or Bug 332735 ?

Revision history for this message
Brian (brian-schaefer-88) wrote :

Sure. In the file I set up the ellipse and polygon as I had it when I found the bug. You'll have to zoom in the maximum zoom to see

what I'm talking about on each point of the polygon. I just reported a bug a few minutes ago ( Bug #1354249 "Rotated ellipse

and measurements changed") and I noticed that it changes 15,30,60, and 75 degrees (basically increments other than 45 or 90

degrees). Why does the ellipse do?

Bug 332735 sounds like it. Bug 997571 is a little over my head sorry lol.

Thanks for replying.

Revision history for this message
Alvin Penner (apenner) wrote :

Just writing to indicate that the errors you are seeing here are consistent with what you would theoretically expect if you fit a Bezier to an arc. In Inkscape it is inevitable that this fit will be done at some point, it's really just a question of when it is done, and who does it. The Inkscape history is a bit complicated because it used to be done explicitly, while now it is done somewhat indirectly in the conversion to sbasis representation, and the conversion to sbasis has also changed a bit in the last year. See for example:

http://article.gmane.org/gmane.comp.graphics.inkscape.devel/35435
http://inkscape.13.x6.nabble.com/Recent-change-to-ellipse-to-path-conversion-method-td4968499.html#a4968833
http://bazaar.launchpad.net/~lib2geom-hackers/lib2geom/trunk/revision/2122

So the current method is to take a full circle and represent it as 4 arcs, and then fit a Bezier to each of these arcs. The Bezier is fit such that it matches perfectly at the endpoints and also at the middle. For a 90 degree arc on a unit circle the Bezier control arm length is given by 4*(sqrt(2) - 1)/3. For a unit circle you can calculate the radius of the Bezier curve at different angles to get the following table:

t theta radius
0 0 1
.21 19.32 1.000273
.25 22.90 1.000259
.33 30.01 1.000166
.50 45 1
.67 59.99 1.000166
.75 67.10 1.000259
.79 70.68 1.000273
1 90 1

In your example, at 60 degrees, if I zoom in as close as possible, I estimate the error to be about 0.03 pixels. The radius is 180 pixels. So the relative error is about 0.00016. This is consistent with the above table at 60 degrees.

fwiw, if you print this at its original size, then you will need to have a printer with a resolution of about 3000 dpi in order to see the error.

su_v (suv-lp)
tags: added: precision
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.