I just posted a new demo project called RandomBlobs to github.
It creates a couple of different kinds of random, smoothly curved, non self-intersecting shapes.
It starts out creating a UIBezierPath that is an irregular 8-sided polygon.
It then uses a modified version of a "Catmull-Rom" curve generating recipe I got from Erica Sadun's "The Core iOS 6 Developer's Cookbook" to turn the polygon into a smoothly curved shape.
It installs the CGPath from the resulting UIBezierPath into a CAShapeLayer, which draws the path.
Since all the resulting CGPaths have the same number and type of control points, it was trivial to make the program animate the shape changes, so when you click the "Change shape" button in the app, the shape morphs before your eyes.
Download the project from github and give it a look.
It creates a couple of different kinds of random, smoothly curved, non self-intersecting shapes.
It starts out creating a UIBezierPath that is an irregular 8-sided polygon.
It then uses a modified version of a "Catmull-Rom" curve generating recipe I got from Erica Sadun's "The Core iOS 6 Developer's Cookbook" to turn the polygon into a smoothly curved shape.
It installs the CGPath from the resulting UIBezierPath into a CAShapeLayer, which draws the path.
Since all the resulting CGPaths have the same number and type of control points, it was trivial to make the program animate the shape changes, so when you click the "Change shape" button in the app, the shape morphs before your eyes.
Download the project from github and give it a look.