freetype-devel
[Top][All Lists]
Advanced

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

Re: [ft-devel] a satisfactory fix for the cubic spline bug


From: GRAHAM ASHER
Subject: Re: [ft-devel] a satisfactory fix for the cubic spline bug
Date: Tue, 31 Aug 2010 17:17:31 +0000 (GMT)

And putting this equation into more standard quadratic form I get

d_norm(v) = 0.072(v^2) + 0.229v + 0.449

which yields 0.75 as expected for v = 1, so it looks as though I have the right equation here.

Graham


From: GRAHAM ASHER <address@hidden>
To: David Bevan <address@hidden>
Sent: Tuesday, 31 August, 2010 17:07:52
Subject: Re: [ft-devel] a satisfactory fix for the cubic spline bug

Can you give the workings? The equation I think you mean is this one:

0.07200(v + 3.180556)v + 0.449000,

so when I substitute 0.1 for v I get

0.07200(0.1 + 3.180556)0.1 + 0.449000

which gives 0.47262, and multiplying that by 50, the maximum deviation of a control point, gives 23.631, not your y value, so obviously I'm missing something;

Thanks,

Graham


From: David Bevan <address@hidden>
To: GRAHAM ASHER <address@hidden>
Sent: Tuesday, 31 August, 2010 16:20:08
Subject: RE: [ft-devel] a satisfactory fix for the cubic spline bug


From: GRAHAM ASHER [mailto:address@hidden
Sent: 31 August 2010 15:56
To: David Bevan
Subject: Re: [ft-devel] a satisfactory fix for the cubic spline bug

 

Midpoint as defined by bisection is the point you get when you split a cubic spline into two by the bisection method (as used by FreeType in gray_split_cubic). It is defined as the midpoint of the line between the two midpoints of the lines between the three midpoints of the lines between the four control points, taken in order. It is of course a point on the curve.

So that’s the point t = 0.5 in the parametric equation — found using de Casteljau’s algorithm.

 

Your example gives a midpoint of (31.25, 20.625). Applying the midpoint method again (hastily) to the left-hand curve seems to yield a y coordinate of 21.84375, so if my arithmetic is correct your example is a good one.

Using the equation in Hain’s paper (p.4; with v=0.1), the maximum deviation tmax in my example is at 0.3503928884, which is the point (16.26529900, 23.37564709).

 

David %^>

 

Thanks,

Graham

 


From: David Bevan <address@hidden>
To: GRAHAM ASHER <address@hidden>
Sent: Tuesday, 31 August, 2010 15:20:59
Subject: RE: [ft-devel] a satisfactory fix for the cubic spline bug


From: GRAHAM ASHER [mailto:address@hidden
Sent: 31 August 2010 15:01
To: David Bevan; freetype-devel
Subject: Re: [ft-devel] a satisfactory fix for the cubic spline bug

 

David,
(vi) Out of interest, please give an example, with coordinates, of a cubic spline with both control points on the same side of the straight line from start to end, for which the midpoint of the curve, as defined by bisection, is not the point of maximum deviation.

I expect that something like the following would be an example:

 

P0: 0,0

P1: 0,50

P2: 50,5

P3, 100,0

 

But to be sure I’d need to know what you mean by “midpoint as defined by bisection”? Is it t = 0.5 in the parametric equation, the point perpendicular to the midpoint of the chord, or something else?

 

David %^>


reply via email to

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