I found that stacking circles with alternating radii wasn't accurate enough for me, especially for large spheres. That's why I've written a script to generate mathematically perfect spheres.
(Click to enlarge. Credits to IscopeU for building this.)
This was done by using a (larger version of a) blueprint like this one:
If you don't see how it's done right away, there's a description below.
- No redundant voxels. The blueprints presented here have the minimum amount of blocks, you cannot remove any of the voxels without creating a hole in the sphere.
- Cubic symmetry, that is, the spheres are perfectly symmmetric with respect to the cubic nature of Minecraft. They look exactly the same if you look at them from the top, left, front etc.
How to use them
Here's an example of one of the blueprints. For the sake of simplicity I've chosen the one with diameter 3. Don't worry, for bigger spheres the images are clearer.
- Open the blueprint in some graphics program. Even MSPaint should be enough. Zoom in so you can easily see the different pixels.
- Look at the first image, i.e. the one on the very left. Build this pattern on the ground in front of you; one black pixel corresponds to one block in Minecraft. In the end, you've got some roughly circle-shaped object lying flat on the ground to your feet. In the diameter 3 case, that's some kind of a plus-shaped object.
- It's time for the second layer. Your first layer was on the ground level, the second layer is on the level above ground level. Build the second layer "in the air" above your first layer. You've now got a plus, and a donut of blocks above it.
- Build the third layer according to the blueprint ontop of your donut (layer 2).
- Done! That's your diameter 3 sphere. It looks a bit edgy, but that's the limitation of the voxels. The larger the spheres are, the rounder they look.
Here they are, ordered by diameter.
(Red numbers indicate the middle layer(s).)
If the connection times out, it is a temporary error. The server will be running at least until october 2012 (but most probably longer). Anyway, I've packed all images and uploaded them here in case you can't wait.
                                                                                                                               
About the algorithm
It's basically a really mindless straight forward procedure: Calculate sphere, convert to image. I did pay no attention to effectivity, so especially larger spheres are really messy to calculate. You can view the source code here; because I never intended to post it online it's pretty short on comments though.
A rough outline of the algorithm is as follows:
- Generate a 3D array of size Diameter^3, fill with zeros. Each entry corresponds to one voxel.
- Walk through all entries. If the entry is inside the sphere, set it to 1.
- Optional: If a hollow sphere is desired, walk though all the entries again and set all those to 0 that are not at the boundary.
- Generate image out of the array, and display the z sections next to each other.
Larger spheres, more complex geometries
There are some other players around who have written programs similar to mine.
- The executable available at http://perfectsphere.codeplex.com/, written by distantcam, allows much larger spheres to be generated.
- An application that converts arbitrary 3D shapes to voxels: http://www.patrickmin.com/minecraft/