Comment 13 for bug 653315

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

    I believe that I have found the source of the problem, and that it is indeed caused by a poor conversion formula when converting from an arc to a Bezier (blush).
    When you originally load the svg file, the XML editor shows the path in the form of its arc representation, while the Node tool shows Bezier control arms (very confusing). If you use the Node tool and jiggle one of the Bezier points slightly to force a refresh, then the XML editor will show the Bezier path that the curve has been converted to. By doing this for a few different cases, I have confirmed that the formula that is being used in the conversion from arc to Bezier form is:

d/r = theta/3

where:

d = Bezier control arm length
r = radius
theta = angle of arc

This formula is a correct zeroth-order approximation as theta approaches zero, but it is not at all suitable at the large arc angles that are being encountered in the attached image. A better formula to use would be 4*tan(theta/4)/3, as implemented in Bug 332735.

    Unfortunately, I do not know where to apply this patch, so this is a request for technical assistance.

    The file src\sp-ellipse.cpp is apparently responsible for performing the arc-to-Bezier conversion for those objects that have sodipodi attributes. Somewhere there must be a parallel file that is used for the conversion from arc-to-Bezier for those objects that do not have sodipodi attributes, but I have no clue where that file might be physically located.

 Any help in searching would be welcome.