Fifty Ways to Draw a Circle
This project is an exploration of generating a circle in fifty different ways. You can read about the motivation for the project here. This was inspired by Manohar Vanga's very similar project, but the code is all my own.
The source code for each circle is stored in its own directory. Each circle is meant to stand on its own, and can be used elsewhere, but there are some source files that are shared between implementations. These shared source files are stored in the "main" directory:
click.pde: a very simple
main()that draws a circle centered on whatever point the mouse clicks on.
main()that allows you to select four nice-looking examples of the current circle implementation. It creates an image file with those four circles, and saves the random seeds used to generate them.
main()that takes a file containing four random seeds, and generates an image that's twice as large as the one created by pick.pde.
main.pde: a symbolic link to one of the three above files.
mask.pde: code to apply a circle-shaped mask to an image while retaining the image's own alpha channel data. This is needed by seven of the circle implementations.
JAVA2D.pde: a line of code indicating that the current sketch should use the default (
P2D.pde: a line of code indicating that the current sketch should use the
The files with
main() routines were useful for development of the circles,
but they are not needed to use the circle code elsewhere. Each circle must
use exactly one of the renderer files (JAVA2D.pde or P2D.pde) to indicate
which renderer it wants to use; the masking code (mask.pde) uses this
information, and any settings() routine should respect this choice as well.
For some discussion of the differences in renderer behavior, see
I added a fourth constraint to my implementation, aside from the three
mentioned in my description. Namely, I
wanted each circle to be totally recreatable given a random seed. The
main() in pick.pde and grow.pde work together on this -
they both seed Processing's random number generators before drawing a given
circle, and pick.pde keeps track of which random seeds it used and stores them
in a text file after it's done. You can see the random seeds used to create
each of the sample images