[cairo] Mathematics question

Andrea Canciani ranma42 at gmail.com
Wed Nov 10 13:20:54 PST 2010


On Wed, Nov 10, 2010 at 9:31 PM, Behdad Esfahbod <behdad at behdad.org> wrote:
> On 11/04/10 00:38, Jeff Muizelaar wrote:
>>
>>> 3. When approximating curves to lines (flattening before
>>> rasterization), how algorithm is used by cairo and how it competes to
>>> the others? I found very interesting article (
>>> http://www.cis.usouthal.edu/~hain/general/Publications/Bezier/Bezier%20Offset%20Curves.pdf
>>>
>>> ) that describes parabolic approximation. Is here anybody familiar
>>> with this method?
>> Cairo recursively subdivides a curve until the maximum distance
>> (squared) between the control points B or C and the line A-D is less
>> than the tolerance.
>>
>> I've seen this paper before, but haven't tried implementing it to see
>> how it compares.
>
> There is an optimized heuristic implementation of that paper in FreeType
> master now.  Worth taking a look at.

FreeType includes the implementation of another paper by the same author:

http://www.cis.southalabama.edu/~hain/general/Publications/Bezier/Camera-ready%20CISST02%202.pdf

The two techniques are unrelated, but both allow to reduce the number
of segments in which a bezier curve is subdivided. This is basically a
comparison of the two techniques:

http://www.cis.usouthal.edu/~hain/general/Theses/Ahmad_thesis.pdf

Andrea


More information about the cairo mailing list