freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Problems with bbox code and cubic bezier curves


From: Tom Kacvinsky
Subject: Re: [Devel] Problems with bbox code and cubic bezier curves
Date: Mon, 23 Apr 2001 10:22:19 -0400 (EDT)

There are other problems here -- use of the trig functions!  Do we want
to start linking against -lm?  Or do we want to implement trig functions
using 16.16 fixed values?  Ugh!

On Mon, 23 Apr 2001, Werner LEMBERG wrote:

>
> > Toby pointed out that the bounding box of a bezier can be computed by
> > computing the max and min of the x and y coords of the parametric equation
> > of the curve, which for a cubic would occur at either the end points or the
> > solutions of:
> >
> > t^2[A-3B-C-3D] + t[2B+6D] + [C-3D]
> > where A,B,C,D are the x or y coords of the control points.
> >
> > This requires 2 sqrts per curve, but I suspect that that would be
> > cheaper than an unknown number of splits?
>
> Exactly.  It is possible to construct third order Bezier curves which need
> o(n) splits, where n is the length or height of the coordinate bounding box.
> Even in real life this can happen with rotated outlines.  Attached is a code
> snipped from Richard Kinch (he was so kind to send it to me) which solves the
> problem.  He uses real floats, and I haven't found time to convert it to fixed
> floats (and, admittedly, I'm a bit weak in doing that).
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]