Tuesday, December 13, 2011

Dodecahedron in Disguise

I like this image, created while experimenting with MagicTile last night.

It is a spherical dodecahedron with a set of five concentric circles surrounding each vertex, and stereographically projected to the plane.

Sunday, December 11, 2011

Interference Patterns

Edmund Harris recently posted some beautiful pictures created with modular arithmetic. I was surprised and intrigued to see this one, because it so closely resembled an image I made some years ago without thinking about modular arithmetic at all. I dug through my disorganized backups, and finally found it from circa 2004.

These images don't resize well. The scaling can both remove structure and produce artifacts that are not in the original, so here is an example detail portion of the full image.

You can click here for the full version (4.5 MB).

These images are fractal looking, with repeating patterns at smaller scales. You can see the integers and fractions living in there. Perhaps cooler, the smaller repetitions seem to exist on a "higher level" than the basic repeating unit. They float along the patterns below, having a sort of ethereal existence.

If Edmund used modular arithmetic, how was my image made? Consider the function sin(x2). Here is a plot of it in the range of 0 to 15. You can see the frequency of the oscillations is increasing quickly with larger x.

Now consider sampling this function at discrete values of x in the larger range of 0 to 1000. When you get to higher values of x, this continuous function is oscillating back and forth a huge number of times between each successive value of x. Is there a pattern to be seen in the discretely sampled output values?

Finding a pattern on a 1D line is not so easy, but you can plot discrete values of sin(d2) on a 2D grid, where d is the distance of an image pixel to the origin. When the function value for each discrete pixel is calculated and plotted as a color, voila! The image appears, and the patterns undeniably jump out.

At the time, I attributed the effect to a Moire-like phenomenon, with an interference between the discrete grid of pixels and the continuous function. It was neat to read Edmund's explanation that modular arithmetic is behind the scenes. Maybe modular arithmetic is part of the magic behind Moire patterns?

I experimented with other functions as well, and here is a favorite. I love that it has both elliptical and hyperbolic patterns in it, and the transitioning between the two.

You can click here for the full version (2 MB).

Tuesday, May 17, 2011

Three Different Views of the Same Tiling

Here are three images of the same {4,6} tiling. The "{4,6}" notation is called the Schläfli symbol. The 4 means it is a tiling of squares. The 6 means that 6 squares meet at every vertex. Check it in the pictures!

A view centered on a square:

A view centered on an edge:

A view centered on a vertex:

I bet you noticed that the tiling is checkerboarded (hyperbolic chess anyone?). Can you figure out what property is required to allow a tiling to be checkerboarded? If so, let me know in the comments!

Q: What made these pictures?

Sunday, April 17, 2011

Geodesic Saddles

It's highly likely you've seen a geodesic dome before.

After briefly starting to optimize triangle counts for textures in MagicTile, I had a fun realization. The triangle patterns sparked the idea that there could be a precise hyperbolic analogue to a geodesic dome. I was compelled into the diversion, and with minor code changes made some pretty pictures of "geodesic saddles". (That seems like a nice name for these objects anyway.) Alas, my intended optimizations are yet to be done, but at least I can present this geodesic saddle based on the {3,7} tiling :)

Can you find some of the "knots"? That may not be the proper term, but I mean those rare points in the saddle where seven triangles meet at a vertex instead of six. On a geodesic dome, which is usually based on the spherical {3,5} tiling (aka icosahedron), the analogous points are the rare vertices where five triangles meet instead of six. I find knots easier to spot on a geodesic saddle derived from a {3,9} tiling.

Geodesic domes and saddles are generated by taking the tiles in a triangular tiling and subdividing each of them into smaller triangles. Hence, triangular numbers make a cameo in the calculations. For these pictures, I chose to subdivide the original triangles with eight new triangles per side.

But there was one thing that tripped me up quite a bit. I began by mistakenly thinking I could subdivide the triangle edges of the original tiling equally, and then interpolate interior points thereafter. As much as I tried, things just wouldn't line up quite right, and I wasn't seeing the geodesics that I expected. It turns out that all the small triangle edges have varying lengths, something that is also true for a geodesic dome. Compare the proper {3,9} geodesic saddle above with the waviness of an incorrect effort.

I've been showing these pictures in the Poincare Disk, and I don't have unprojected renderings at the moment. But despite this, one thing is certain - a portion of geodesic saddle would make for a unique and fantastic jungle gym!

Related links:

Friday, April 1, 2011

Tragedy of the Commons (and more)

The whole world is a comedy to those that think, a tragedy to those that feel.
-Horace Walpole

Can you guess which camp I'm in? My answer told me a little something about me.

I tip my hat to AbstruseGoose for the quote (my favorite online comic by orders of magnitude)...

Monday, March 28, 2011

Happy Bugs

Programming mistakes might usually lead to a crash, lost work, tears, etc., but here are a couple pleasant surprises courtesy of MagicTile coding goofs.

The following was caused by a coloring bug. I accidentally left out a line of code, which caused the yellow and black outline colors to take over in a completely unexpected way.

This past weekend, I was testing slicing off the tips of polygons in a hyperbolic tiling, and saw this beautiful, fortuitous image appear on my screen.

The cause... I had failed to tell the slicing code to recalculate the centers of the sliced up pieces, so they were way off from where they should have been. The intended (much less satisfying) outcome was this.

I liked the unanticipated effect, so captured a couple more pictures before fixing the bug :)