← Back to team overview

registry team mailing list archive

[Bug 653315] Re: Bezier curves drawn, where svg file requires circular arcs

 

    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.

-- 
Bezier curves drawn, where svg file requires circular arcs
https://bugs.launchpad.net/bugs/653315
You received this bug notification because you are a member of Registry
Administrators, which is the registrant for Debian.