On Mon, 2013-08-12 at 14:07 +0800, Auguste Pop wrote:
> On Mon, Aug 12, 2013 at 12:38 PM, Auguste Pop <auguste@...>
> On Mon, Aug 12, 2013 at 12:21 AM, Jasper van de Gronde
> <th.v.d.gronde@...> wrote:
> On 2013-08-10 07:14, Auguste Pop wrote:
> > ...
> > Should I file a bug report? Please comment.
> It is not entirely clear to me in what way the
> approximation is /wrong/.
> It is impossible to represent a circular arc using a
> Bézier curve, and
> there is thus not one best approximation. In my
> experience the curves
> look pretty decent, if you have an example where the
> approximation is
> clearly of very bad quality, that would be
> As for the inconsistency, that could indeed be
> considered a bug.
> (Although as long as both approximations are of
> sufficient quality, I
> wouldn't be too worried.)
> I said the approximation is "wrong" because there's no
> literature or resource that I am aware of comes up with this
> solution. I know an circular arc can not be represented by a
> cubic bezier curve losslessly. But with a certain criteria,
> there's certainly a "best" approximation. The "best"
> approximation may be very difficult to calculate, so we will
> finally use some "good" answers. The traditional approximation
> which puts the middle point of bezier curve on the arc is one
> of the "good" answers. In any case, the approximation used by
> "Edit path by nodes" is not "good" nor "best".
> Of course, this can not be "wrong" as the error is still
> relatively slow to human eyes. When inkscape is treated as a
> design tool, this behavior is acceptable. But as a computer
> program, it is using the "wrong" equation mathematically.
> Best regards,
> In order to illustrate how large the error is, I have included a two
> graphs. These graphs show the absolute error from a point on the
> bezier curve to the circle. We get the graphs with the assumption that
> we are approximating a pi/4(45 degrees) arc on an unit circle.
> The traditonal.png shows the error when using the traditional method.
> And the comparison.png shows the both errors from the traditional
> method and the method i think "wrong". Although the method in question
> still gives a relatively small error (about one thousandth), it is
> significantly worse than the traditional method (max error on 10^-6
> Best regards,
A few comments:
1. The SVG spec requires rendering precision to be within 1 px. With
regard to the spec, the errors are negligible. Of course, we should do
the best we can within reason.
2. SVG 2 will allow markers on rectangles and other shapes. Conversion
of shapes to paths should not changes how markers are placed. An
ellipse/circle will have four markers, at the top, bottom, and two sides
(0, 90, 180, 270 degrees). A rectangle will have four markers if the
corners are not rounded and eight markers if they are.
3. Inkscape tends to use Beziers when arcs might be better. In any case,
an arc should not be converted to two Bezier path segments as this
changes the number of markers.