Ammann A4 Tiling
Thanks to Christian Mercat News Feed.
Inspired by Something nerdy, @ayliean.
Tilings Encyclopedia : Amman A4 Tiling
Setup
s = sqrt(2)-1
t = sqrt(2)
p = sqrt(2)+1
# Affine transformation matrices
#------------------------------------
W1= {{ 0, s, 0}, {-s, 0, 0}, {0,0,1}}
W2= {{ s, 0, t}, { 0, s,-t}, {0,0,1}}
W3= {{ s, 0,-t}, { 0, s, t}, {0,0,1}}
H0= {{ s,0,s-1}, { 0,-s, t}, {0,0,1}}
H1= {{ 0, s, 0}, { s, 0,-2}, {0,0,1}}
H2= {{-s, 0, 2}, { 0,-s, 0}, {0,0,1}}
H3= {{ 0,-s, 0}, {-s, 0, 2}, {0,0,1}}
H4= {{ s, 0,-2}, { 0, s, 0}, {0,0,1}}
# Basic shapes
#------------------------------------
w1= Polygon({(-1,-p),(p,-p),(p,1),(1,1),(1,p),(-p,p),(-p,-1),(-1,-1)})
h1= Polygon({(-1,-p),(p,-p),(p,1),(s,1),(s,p),(-1,p)})
# Iterations
#------------------------------------
w2= Zip(ApplyMatrix(M,O), M, {W1,W2,W3,H1,H2,H3,H4}, O, {w1,w1,w1,h1,h1,h1,h1})
h2= Zip(ApplyMatrix(M,O), M, {W1,W2,H0,H1,H2}, O, {w1,w1,h1,h1,h1})
w3= Zip(ApplyMatrix(M,O), M, {W1,W2,W3,H1,H2,H3,H4}, O, {w2,w2,w2,h2,h2,h2,h2})
h3= Zip(ApplyMatrix(M,O), M, {W1,W2,H0,H1,H2}, O, {w2,w2,h2,h2,h2})
w4= Zip(ApplyMatrix(M,O), M, {W1,W2,W3,H1,H2,H3,H4}, O, {w3,w3,w3,h3,h3,h3,h3})
h4= Zip(ApplyMatrix(M,O), M, {W1,W2,H0,H1,H2}, O, {w3,w3,h3,h3,h3})
w5= Zip(ApplyMatrix(M,O), M, {W1,W2,W3,H1,H2,H3,H4}, O, {w4,w4,w4,h4,h4,h4,h4})
h5= Zip(ApplyMatrix(M,O), M, {W1,W2,H0,H1,H2}, O, {w4,w4,h4,h4,h4})
#------------------------------------
# Settings
#------------------------------------
SetActiveView(1)
CenterView((0,0))
ShowAxes(false)
ShowGrid(false)
shape= Slider(1,2,1, 1, 50, false)
level= Slider(1,5,1, 1,100, false)
SetValue(shape,1)
SetValue(level,4)
SetCoords(shape, 40, 450)
SetCoords(level, 40, 500)
List={"w1","h1","w2","h2","w3","h3","w4","h4","w5","h5"}
Execute(Zip("SetColor("+obj+",0,0,0)", obj,List))
Execute(Zip("SetFilling("+obj+",0)", obj,List))
Execute(Zip("SetLineThickness("+obj+",4)", obj,List))
Delete(List)
Execute(Zip("SetConditionToShowObject(w"+k+",shape==1 && level=="+k+")", k,1..5))
Execute(Zip("SetConditionToShowObject(h"+k+",shape==2 && level=="+k+")", k,1..5))