![[Graphics:Images/index_gr_1.gif]](Images/index_gr_1.gif)
A tiling of the plane is a collection of closed sets which cover the plane and intersect only in their boundaries. A simple checkerboard pattern is an example of a tiling using squares. The image above is an example of a tiling by copies of a set called the terdragon. Sets like the terdragon which tile the plane and have a fractal boundary are called fractiles.
The square and the terdragon are both self-similar sets. In general, a two dimensional self-similar subset of the plane will tile the plane. (Technicality: The open set condition must be satisfied to ensure overlapping in just the boundaries.)
To generate fractiling images, we first need the IFS to describe the set. The following three functions form the IFS for the terdragon.
rotate[theta_] := {{Cos[theta], -Sin[theta]},
{Sin[theta], Cos[theta]}};
f = {rotate[-Pi/6]/Sqrt[3],{0,0}};
g = {rotate[Pi/2]/Sqrt[3],{1/2,-Sin[Pi/6]/Sqrt[3]}};
h = {rotate[-Pi/6]/Sqrt[3],{1/2,Sin[Pi/6]/Sqrt[3]}};
We can use the DigraphFractals package to generate an image of the terdragon.
Needs["DigraphFractals`"];
terdragonDigraph = {{{f, g, h}}};
ShowDigraphFractals[terdragonDigraph, 9];
![[Graphics:Images/index_gr_2.gif]](Images/index_gr_2.gif)
In order to get nicer images, we need to define our initiators a bit better. The initiators should be of the form:{Color, Polygon[vertices], Black, Line[vertices]}, where vertices are points defining the vertices of a good polygonal approximation to the boundary of the terdragon. It turns out that the boundary of the terdragon is the union of two self-similar sets. The following code generates initiators of order depth.
TDInit[depth_] := Module[
{rotate, T1Func, T2Func, step, initialPoints,
line1, line2, line},
rotate[theta_] := {{Cos[theta], -Sin[theta]},
{Sin[theta], Cos[theta]}};
T1Func = (rotate[-Pi/6]/Sqrt[3]) . #1 & ;
T2Func = (rotate[-5*Pi/6]/Sqrt[3]) . #1 + {1, 0} &;
initialPoints = {{0, 0}, {1, 0}}; step[points_] :=
Partition[Flatten[{T1Func /@ points,
Drop[Reverse[T2Func /@ points], 1]}], 2];
line1 = Nest[step, initialPoints, depth];
line2 = Drop[({{-1, 0}, {0, -1}} . #1 + {1, 0} & ) /@
line1, 1];
line = Partition[Flatten[{line1, line2}], 2];
{GrayLevel[0.7], Polygon[line], GrayLevel[0], Line[line]}];
Show[GraphicsArray[Graphics /@ {TDInit[4], TDInit[8]}]];
![[Graphics:Images/index_gr_3.gif]](Images/index_gr_3.gif)
We can now generate tilings using this type of initiator.
{decomp} = ShowDigraphFractals[terdragonDigraph,
1, Initiators -> {{TDInit[9]}}];
![[Graphics:Images/index_gr_4.gif]](Images/index_gr_4.gif)
SeedRandom[6];
Show[decomp /. GrayLevel[0.7] :>
Hue[Random[], 0.5, 0.7]];
![[Graphics:Images/index_gr_5.gif]](Images/index_gr_5.gif)
{pic} = ShowDigraphFractals[terdragonDigraph, 4,
Initiators -> {{TDInit[7]}}, DisplayFunction -> Identity];
coloredPic = Partition[Flatten[pic[[1]]],12] /.
{GrayLevel[.7],Polygon[points1_],GrayLevel[0],Line[points1_],
GrayLevel[.7],Polygon[points2_],GrayLevel[0],Line[points2_],
GrayLevel[.7],Polygon[points3_],GrayLevel[0],Line[points3_]} ->
{Hue[0,.5,.7],Polygon[points1],GrayLevel[0],Line[points1],
Hue[1/3,.5,.7],Polygon[points2],GrayLevel[0],Line[points2],
Hue[2/3,.5,.7],Polygon[points3],GrayLevel[0],Line[points3]};
Show[Graphics[coloredPic], AspectRatio -> Automatic];
![[Graphics:Images/index_gr_6.gif]](Images/index_gr_6.gif)
Here is the code to generate the image at the top of the page.
tdInit = TDInit[3];
td1 = tdInit /. GrayLevel[0.7] -> Hue[0, 0.5, 0.7];
td2 = tdInit /. {{x_?NumericQ, y_?NumericQ} :>
rotate[Pi/3] . {x, y},
GrayLevel[0.7] -> Hue[1/3, 0.5, 0.7]};
td3 = tdInit /. {{x_?NumericQ, y_?NumericQ} :>
rotate[2 Pi/3] . {x, y} + {1, 0},
GrayLevel[0.7] -> Hue[2/3, 0.5, 0.7]};
FFToTD = Graphics[{td1, td2, td3}];
FFToTDs = Table[FFToTD /. {x_?NumericQ, y_?NumericQ} :>
{x, y} + i {1/2, Sqrt[3]/2} + (j - Floor[i/2]) {1, 0},
{i, 0, 3}, {j, 0, 4}];
Show[FFToTDs, PlotRange -> {{0.8, 4.8}, {1/2, 2}},
AspectRatio -> Automatic];