Re: How to import drawing paths into a Cocoa application?
Re: How to import drawing paths into a Cocoa application?
- Subject: Re: How to import drawing paths into a Cocoa application?
- From: Jens Alfke <email@hidden>
- Date: Sat, 26 Apr 2008 21:44:31 -0700
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
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden