Skip navigation.
 
mlRe: How to import drawing paths into a Cocoa application?
FROM : Jens Alfke
DATE : Sun Apr 27 06:44:31 2008

On 26 Apr '08, at 7:24 PM, John C. Randolph wrote:

> I've asked several math majors over the years if they could give me 
> an exact function for the length of a bezier curve.  They've 
> generally told me it was possible, but none of them actually 
> produced it.



A math major's notion of "an exact function" probably allows integral 
signs. :-P

I looked into similar operations on cubic curves (though not 
specifically path length) years and years ago when I worked on a font-
design program. There are a few easy operations, like getting the 
bounding-box, but otherwise the math tends to get really hairy. In the 
case of length, you're solving a path integral, and if I remember my 
college calculus*, the integrand will be a tangle of roots of sums of 
sixth powers.

Everything I've read since indicates that the universal solution is to 
flatten the curves and do the rest of the work on polygons, which is 
far easier. (One of the exceptions was Apple's old QuickDraw GX: like 
TrueType fonts, it was based on quadric curves, which are less 
flexible but mathematically more tractable. GX apparently had code for 
doing a lot of operations directly on curves without having to flatten 
them first.)

—Jens

* I don't. o_O

Related mailsAuthorDate
mlHow to import drawing paths into a Cocoa application? Steve Weller Apr 22, 02:23
mlRe: How to import drawing paths into a Cocoa application? Graham Cox Apr 22, 02:35
mlRe: How to import drawing paths into a Cocoa application? Graham Cox Apr 22, 02:46
mlRe: How to import drawing paths into a Cocoa application? Steve Weller Apr 27, 00:43
mlRe: How to import drawing paths into a Cocoa application? John C. Randolph Apr 27, 04:24
mlRe: How to import drawing paths into a Cocoa application? Graham Cox Apr 27, 06:23
mlRe: How to import drawing paths into a Cocoa application? Jens Alfke Apr 27, 06:44