Erica Sadun published a cool little Swift playground that draws images like the old Spirograph that we played with as kids. The thing is, it wasn’t immediately clear how to use it. I fooled around with it and got it working.
Here’s Erica’s part:
Now, how do you produce images from that? Basically, you just need to create an image context and draw into it. Here’s my part:
// sample size
Now you should just be able to view the image by clicking on the eye icon. By varying the radii and the number of iterations, you can produce some neat images in an Xcode 6 Playground.
Edited on 2014-08-29 16-13-31
Generator is now
GeneratorType and fixed issue with diappearing
* symbols here and there.