Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to import drawing paths into a Cocoa application?




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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >How to import drawing paths into a Cocoa application? (From: Steve Weller <email@hidden>)
 >Re: How to import drawing paths into a Cocoa application? (From: Graham Cox <email@hidden>)
 >Re: How to import drawing paths into a Cocoa application? (From: "John C. Randolph" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.