Add NSBezierPath's -bezierPathByFlatteningPath: to UIBezierPath

Originator:gmws82
Number:rdar://15217701 Date Originated:10/13/13
Status:Open Resolved:No
Product:iOS SDK Product Version:N/A
Classification:Feature (new) Reproducible:N/A
 
Summary:
NSBezierPath offers -bezierPathByFlatteningPath: to approximate a curved path with only straight line segments. This is incredibly useful for a number of geometric tasks such as attempting to find the smallest bounding circle for an irregular shape. Unfortunately, no such method exists for UIBezierPath on iOS.

Similar functionality may be achieved with a CGPathApplierFunction, but doing so is non-trivial to begin with, and nearly insurmountable for anyone attempting to reproduce the nuances of NSBezierPath's path flattener. These include a customizable granularity (or "flatness"), and a variable segment length to account for tight curves where many segments are needed to create a good approximation, versus wide curves where fewer segments are required to achieve the same result.

Please bring this API to iOS! Thank you!

Notes:
This may not be the only part of NSBezierPath's API that UIBezierPath could stand to gain. Both are strong in some areas and weak in others, and both could benefit greatly from someone taking a look at these differences and trying to reconcile them into a more unified API, with more of each other's strengths and less of each other's weaknesses.

Configuration:
This feature is not present in the iOS 7 SDK as of 10/13/13.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!