To reduce the number of distinct polygons (stones) by as much as possible, only two locations are selected. The first is on-center of the grid, and the second is perturbed by some amount from the center of the grid. Whether the point is left on-center or perturbed is decided using a pseudo-random number generator with a 50% probability. By storing only the seed of the random number generator, the entire pattern can be saved.
The following illustrates one such Voronoi cell, formed by perturbing up and to the right from a grid by 0.2 units.
By extending this to a large section of the plane, we can produce a full tessellation. The following figure shows such a tessellation. The offsets in this case are larger than in the example above. There are 78 unique stones out of 400 total in the center 20x20 section.
Another alternative is to base the pattern on hexagons, rather than squares. This can be achieved by offsetting every other row by half the inter-point distance. Taking this approach leads to the following image, with 133 unique stones.
To compare two stones, the points are first translated to the center of mass. If vertex 1 of stone A matches vertex i+j (or i-j) of stone B for any i and all j, then the stones match.
It is possible to specify a tolerance for the match. For example, this allows stones to be considered identical if their points match within the grout distance. The quoted number of unique stones all assume a tolerance of 3/8 of an inch, although this only reduces the number of unique stones by one for the example above.
Consider the likely shape of a Voronoi cell if an adjacent set of 2x2
points all end up with the same offset. As long as the neighboring
points are distant enough so that the bisectors aren't clipped, the
four stones meeting at the midpoint will share a common point, and
meet at right angles.
To remove this case, we sweep through the points 2x2 at a time, and if
all four have the same offset, the one in the lower right is
flipped. Note that flipping one point can, at most, cause one other
set of 2x2 points to have the same offset. So each flip either reduces
the number of such points by one, or leaves the number the same. Since
flipping along the edges can only reduce the number of such points,
repeating the process will converge.
The following diagram shows the result using the same parameters as
the above figure, but with all 2x2 points with matching offsets
removed.
Although this causes the pattern to repeat itself as well, as long as
the regularity is not noticeable (e.g. spatially separated), this is
not a problem.
The next image consists of 46 unique stones, in a pattern that repeats
every 52 points (the order is bottom to top, then left to right). At
first glance, it is difficult to perceive the regular repeating pattern.
Unfortunately, the same trick applied to hexagonal patterns doesn't
work as well. It yields more polygons for a given repeat rate. This is
caused by the fact that a hexagon pack more tightly than squares, and
therefore have more neighbors.
Local Patterns
The first objection to the pattern based on the rectangular layout was
that some areas had a regular, grid-like appearance. These areas also
tended to have four stones meet in one place. A method was needed to
remove (or at least reduce) these regions.
2x2 points with the same offset removed
Further Stone Count Reductions
Next, we need to reduce the number of unique polygons further. Since a
pseudo-random number generator is used to determine whether each point
is perturbed or not, it is a simple matter to reset the seed
occasionally. Since the shape of a Voronoi cell is determined by the
point in the center and it's nearest neighbors, and since the offset
is small compared to the inter-point distance, the location of adjacent
3x3 points determines the shape of a stone. If the pattern of offsets
in these 9 points repeats, the stone shape repeats.
Points repeat every 52. 46 unique stones.
Adam Janin
janin@icsi.berkeley.edu