I discovered a simple way to generate assign a "nesting number" for each tile in a Penrose "kites and darts" tiling, which results in a really nice way to visualize the tiling (see image above).
Is there a way to generate this "nesting" number from Ammann bars?
Motivation
I want to draw Penrose tilings on shadertoy.com.
Given a pixel coordinate, I want a simple way to determine information about the tile that the pixel covers. This can be done with recursive substitution, but I want to explore using Ammann bars instead.
Why Ammann bars? Given a pixel, it's straight-forward to determine where it lies relative to the nearest Ammann bars (shown in blue) in each of the 5 directions. And this is enough to draw the image above (the Ammann bars determine exactly where the tiles go).
The kites are drawn in green and the darts are drawn in red or yellow (just depending on angle they point to). But how can the "nesting number" be determined? (I'll post an answer that gives an approximate result)
My process for generating "nesting numbers":
- Start with a half-kite with a "nesting number" of 0
- For the next iteration, substitute each tile as shown here
- Half-kites don't change value (they keep the "nesting number" of the parent tile)
- Half-darts add 1 or -1 to the "nesting number" during even or odd iterations respectively
iteration 0: ("nesting number" is 0)
iteration 1: (bottom-left has "nesting number" of -1)
iteration 2: (bottom-left has "nesting number" of -1, and top has two tiles of 1)
iteration 3:
...
iteration 7:
iteration 8:

you can see iterations 0 through 14 as an animation here.

The above image is compressed vertically to make the vertical bars more apparent. Also, the red rectangles illustrate how a section can be recursively deflated into a LONG-SHORT-LONG sequence, where the LONG sections match and the SHORT section is "inverted".
This suggests that Ammann bars defined by that deflation may be useful. Note how the Ammann bar coloring somewhat matches the light/dark areas from the original image.
The above image is from applying the Ammann bars in all 5 directions and adding them.
Note how this result closely corresponds to the desired result.
When tiles are constructed from the Ammann bars, maybe their "nesting number" is related to the nearby Ammann bar colors.