Function Repository Resource:

HatHexagonalTiling (1.0.0) current version: 1.1.2 »

Source Notebook

Generate the hexagonal tiling pattern of the Hat and its supertiles

Contributed by: Bowen Ping

ResourceFunction["HatHexagonalTiling"][init]

plots the hat tiling initial conditions for integer init from 1 to 10.

ResourceFunction["HatHexagonalTiling"][init,size]

plots the hat tiling with init as initial conditions for a hexagonal array of integer size layers.

ResourceFunction["HatHexagonalTiling"][init,size,"type"]

plots the combinatorial tiling of the given type.

Details

ResourceFunction["HatHexagonalTiling"] generates a tiling based on the einstein hat tile of Smith et al., similar to the resource function HatHexagons. However, the two functions generate tilings through different methods.
ResourceFunction["HatHexagonalTiling"] uses combinatorial hexagons to generate tilings through the built-in function SatisfiabilityInstances.
Supported tiling types include the following:
"Hexagon"combinatorial hexagons
"Hat"the Hat tiles
"Cluster"1-level supertiles of the Hat
"SuperCluster"2-level supertiles of the Hat
ResourceFunction["HatHexagonalTiling"] has the same options as Graphics, with the following additions:
ColorFunctionAutomaticfunction with inputs from 1 to 10, gives colors as output.
ColorRulesAutomaticlist of rules from integers (from 1 to 10) to colors.
"Count"1required number of possible tilings.
The setting "Count"All generates all possible tilings.

Examples

Basic Examples (3) 

Plot a single hat tile:

In[1]:=
ResourceFunction["HatHexagonalTiling"][1, ImageSize -> 150]
Out[1]=

Plot a hexagonal tiling of the Hat:

In[2]:=
ResourceFunction["HatHexagonalTiling"][1, 3, ImageSize -> 300]
Out[2]=

Plot with combinatorial hexagon, the Hat and its supertiles:

In[3]:=
ResourceFunction["HatHexagonalTiling"][4, 3, #] & /@ {"Hexagon", "Hat", "Cluster", "SuperCluster"}
Out[3]=

Scope (2) 

There are 10 different initial conditions:

In[4]:=
Grid[Partition[
  ResourceFunction["HatHexagonalTiling"][#, ImageSize -> 100] & /@ Range[10], 5]]
Out[4]=

Compare with its supertiles:

In[5]:=
Grid[Partition[
  Flatten@Outer[
    ResourceFunction["HatHexagonalTiling"][#2, #1, ImageSize -> 100] &, {"Cluster", "SuperCluster"}, Range[10]], 5]
 , Dividers -> {{1 -> True, -1 -> True}, {1 -> True, 3 -> True, -1 -> True}}, FrameStyle -> LightGray]
Out[5]=

Options (5) 

ColorFunction (1) 

Add red EdgeForm in a blue tiling:

In[6]:=
ResourceFunction["HatHexagonalTiling"][1, 2, "Hat", ColorFunction -> Function[{EdgeForm[Red], Lighter[Blue, (12 - #)/12]}], ImageSize -> 300]
Out[6]=

ColorRules (2) 

Color the tiling using GrayLevel:

In[7]:=
ResourceFunction["HatHexagonalTiling"][1, 2, "Hat", ColorRules -> (x_ :> GrayLevel[x/12]), ImageSize -> 300]
Out[7]=

Add red EdgeForm in a blue tiling:

In[8]:=
ResourceFunction["HatHexagonalTiling"][1, 2, "Hat", ColorRules -> (x_ :> {EdgeForm[Red], Lighter[Blue, (12 - x)/12]}), ImageSize -> 300]
Out[8]=

Count (2) 

Use "Count" to generate more possible tilings:

In[9]:=
ResourceFunction["HatHexagonalTiling"][10, 2, "Count" -> 3]
Out[9]=

Generate all valid one layer surroundings:

In[10]:=
Grid[Partition[
  ResourceFunction["HatHexagonalTiling"][1, 1, "Count" -> All, ImageSize -> 150], UpTo[4]]]
Out[10]=

Properties and Relations (2) 

HatHexagons (1) 

The resource function HatHexagons generates tilings by substitution rule, which gives a fractal structure. HatHexagonalTiling focuses on surrounding the center tile by multiple layers. Compare the results of two functions after using the same initial conditions:

In[11]:=
Outer[
  Labeled[
    Row[{Show[ResourceFunction["HatHexagons"][#1, #2], ImageSize -> 100], ResourceFunction["HatHexagonalTiling"][#1, #2, "Hexagon", ImageSize -> 100]}]
    , Style["init:" <> ToString[#1] <> " level:" <> ToString[#2], 12]] &
  , Range[2], Range[0, 2]
  ] // Grid[#, Frame -> {False, All}, FrameStyle -> LightGray] &
Out[11]=

Reflected Tiles (1) 

The holes in the Hat tiling are where the reflected tiles should be. An easy way to fill them is:

In[12]:=
Replace[ResourceFunction["HatHexagonalTiling"][1, 6, "Hat", ImageSize -> 400]
 , {a___, Lighter[Hue[10/11], .6], p_Polygon, b___} :> {
   a, Lighter[Hue[10/11], 0.6], p,
   Lighter[Hue[1], 0.4], Polygon[{{
Rational[-3, 2], Rational[1, 2] 3^Rational[1, 2]}, {
Rational[-3, 2], Rational[3, 2] 3^Rational[1, 2]}, {
Rational[-1, 2], Rational[3, 2] 3^Rational[1, 2]}, {
Rational[1, 2], Rational[5, 2] 3^Rational[1, 2]}, {0, 3 3^Rational[1, 2]}, {
Rational[-3, 2], Rational[5, 2] 3^Rational[1, 2]}, {-3, 3 3^Rational[1, 2]}, {
Rational[-7, 2], Rational[5, 2] 3^Rational[1, 2]}, {
Rational[-9, 2], Rational[5, 2] 3^Rational[1, 2]}, {
Rational[-9, 2], Rational[3, 2] 3^Rational[1, 2]}, {-3, 3^Rational[1, 2]}, {
Rational[-7, 2], Rational[1, 2] 3^Rational[1, 2]}, {-3, 0}} . Transpose[
       RotationMatrix[(ArcTan @@ (p[[1, 2]] - p[[1, 1]])) + Pi/6]] + Threaded[p[[1, 1]]]], b}
 , {2}]
Out[12]=

Neat Examples (1) 

Show the two kinds of tiles next to the reflected tiles:

In[13]:=
ResourceFunction["HatHexagonalTiling"][1, 15, "Hat", ColorRules -> {4 -> Green, 10 -> Red, _ -> LightBlue}, ImageSize -> 600]
Out[13]=

Publisher

Bowen Ping

Version History

  • 1.1.2 – 08 May 2024
  • 1.1.1 – 06 December 2023
  • 1.1.0 – 04 December 2023
  • 1.0.0 – 15 November 2023

Source Metadata

Related Resources

License Information