1 |
// Generation of Penrose aperiodic tilings |
2 |
|
3 |
// Thanks to Herb Savage, who showed it was possible to generate those tilings |
4 |
// with L-systems and Fractint. |
5 |
|
6 |
// Based on decomposition of tilings described in Tilings and Pattern, by |
7 |
// Branko Grunbaum and G.C. Shepard, W.H. Freeman and Company, chapter 10 |
8 |
|
9 |
// Philippe Hurbain |
10 |
// 49 rue Jules Fossier |
11 |
// 95380 LOUVRES |
12 |
// FRANCE |
13 |
|
14 |
|
15 |
ruleset ( |
16 |
// by Herb Savage |
17 |
// based on Martin Gardner's "Penrose Tiles to Trapdoor Ciphers", |
18 |
// Roger Penrose's rhombuses |
19 |
|
20 |
Penrose(n) => attr (delta, 360/10) +WF--XF---YF--ZF, n; |
21 |
W => YF++ZF----XF[-YF----WF]++; |
22 |
X => +YF--ZF[---WF--XF]+; |
23 |
Y => -WF++XF[+++YF++ZF]-; |
24 |
Z => --YF++++WF[+ZF++++XF]--XF; |
25 |
F => ; |
26 |
) |
27 |
|
28 |
ruleset ( |
29 |
// by Philippe Hurbain |
30 |
// Penrose's rhombuses, generated by decomposition rules |
31 |
// x generate the fat rhombus, y the thin one |
32 |
// Individualization of rhombuses allows easy coloring |
33 |
// 0.618034 is ({5-1)/2 |
34 |
|
35 |
Losanges(n) => attr (delta, 360/10) x, n; |
36 |
x => attr (distance, distance*0.618034) +F[|y]--F[|x][|+ attr (distance, distance*0.618034) f attr (distance, distance/0.618034) x]---[x]F--[y]F; |
37 |
y => attr (distance, distance*0.618034) ++[x]F|+F[|y]-[y]F|+F[|x]; |
38 |
F => f; |
39 |
) |
40 |
|
41 |
ruleset ( |
42 |
// by Philippe Hurbain |
43 |
// Simple coloring of Penrose's rhombuses, showing pentagons |
44 |
|
45 |
Penta_color(n) => attr (delta, 360/20) [x]++++[x]++++[x]++++[x]++++[x], n; |
46 |
x => attr (distance, distance*0.618034) ++F[ attr (distance, distance*01.1755) -------F][|y]----F[|x]; |
47 |
x => [|++ attr (distance, distance*0.618034) f attr (distance, distance/0.618034) x]------[x]F----[y]F; |
48 |
y => attr (distance, distance*0.618034) ++++[x]F|++F[|y]--[y]F|++F[|x]; |
49 |
F => f; |
50 |
) |
51 |
|
52 |
ruleset ( |
53 |
// by Philippe Hurbain |
54 |
// Same as PentaColor, but showing only the coloring |
55 |
|
56 |
Penta(n) => attr (delta, 360/20) [x]++++[x]++++[x]++++[x]++++[x], n; |
57 |
x => attr (distance, distance*0.618034) ++f[ attr (distance, distance*01.1755) -------F][|y]----f[|x]; |
58 |
x => [|++ attr (distance, distance*0.618034) f attr (distance, distance/0.618034) x]------[x]f----[y]f; |
59 |
y => attr (distance, distance*0.618034) ++++[x]f|++f[|y]--[y]f|++f[|x]; |
60 |
F => f; |
61 |
) |
62 |
|
63 |
|
64 |
ruleset ( |
65 |
// by Philippe Hurbain |
66 |
// Penrose's kites and darts |
67 |
// k generates the kite, a generates the dart |
68 |
|
69 |
Kites_darts(n) => attr (delta, 360/10) k, n; |
70 |
k => +[ attr (distance, distance*0.618034) a]F attr (distance, distance*0.618034) ---[-k]F-F---[-k] attr (distance, distance/0.618034) F[ attr (distance, distance*0.618034) |a]; |
71 |
a => [ attr (distance, distance*0.618034) k]+F attr (distance, distance*0.618034) [|a]----F+F----[a] attr (distance, distance/0.618034) F; |
72 |
F => f; |
73 |
) |
74 |
|
75 |
ruleset ( |
76 |
// by Philippe Hurbain |
77 |
// Penrose's kites and darts, with kites seed |
78 |
|
79 |
Kites_darts1(n) => attr (delta, 360/10) [k]++[k]++[k]++[k]++[k], n; |
80 |
k => +[ attr (distance, distance*0.618034) a]F attr (distance, distance*0.618034) ---[-k]F-F---[-k] attr (distance, distance/0.618034) F[ attr (distance, distance*0.618034) |a]; |
81 |
a => [ attr (distance, distance*0.618034) k]+F attr (distance, distance*0.618034) [|a]----F+F----[a] attr (distance, distance/0.618034) F; |
82 |
F => f; |
83 |
) |
84 |
|
85 |
ruleset ( |
86 |
// by Philippe Hurbain |
87 |
// Penrose's kites and darts, with darts seed |
88 |
|
89 |
Kites_darts2(n) => attr (delta, 360/10) [a]++[a]++[a]++[a]++[a], n; |
90 |
k => +[ attr (distance, distance*0.618034) a]F attr (distance, distance*0.618034) ---[-k]F-F---[-k] attr (distance, distance/0.618034) F[ attr (distance, distance*0.618034) |a]; |
91 |
a => [ attr (distance, distance*0.618034) k]+F attr (distance, distance*0.618034) [|a]----F+F----[a] attr (distance, distance/0.618034) F; |
92 |
F => f; |
93 |
) |
94 |
|
95 |
ruleset ( |
96 |
// by Philippe Hurbain |
97 |
// Penrose's kites and darts, with serpentine coloring |
98 |
|
99 |
Kites_darts_color(n) => attr (delta, 360/10) [k]++[k]++[k]++[k]++[k], n; |
100 |
k => +[ attr (distance, distance*0.618034) a[f--- attr (distance, distance*0.618) F][--f+++ attr (distance, distance*0.618) F]]; |
101 |
k => F attr (distance, distance*0.618034) ---[-k]F-F---[-k] attr (distance, distance/0.618034) F[ attr (distance, distance*0.618034) |a]; |
102 |
a => [ attr (distance, distance*0.618034) k]+F attr (distance, distance*0.618034) [|a][|f++ attr (distance, distance*0.382) F]----F+; |
103 |
a => F----[a][f-- attr (distance, distance*0.382) F] attr (distance, distance/0.618034) F; |
104 |
F => f; |
105 |
) |
106 |
|
107 |
|
108 |
ruleset ( |
109 |
// by Philippe Hurbain |
110 |
// Ammann's coloring of Penrose's rhombuses, giving an |
111 |
// aperiodic tiling of 2 pentagons and 1 hexagon |
112 |
|
113 |
Ammann_poly_color(n) => attr (delta, 360/10) x, n; |
114 |
x => attr (distance, distance*0.618034) +(36) [ -(9) attr (distance, distance*0.66) F]F[ +(196.5) attr (distance, distance*0.363) F][ +(180) y] -(72) F[ +(180) x]; |
115 |
x => [ -(144) attr (distance, distance*0.618034) f attr (distance, distance/0.618034) x] -(108) [ -(36) attr (distance, distance*0.509) F attr (distance, distance*01.18) -(30) F][x]F[ -(153) attr (distance, distance*0.66) F] -(72) [y]F; |
116 |
y => attr (distance, distance*0.618034) +(72) [x][ -(36) attr (distance, distance*0.509) F]F -(144) [ -(9) attr (distance, distance*0.66) F]F[ +(180) y][ +(196.5) attr (distance, distance*0.363) F]; |
117 |
y => -(36) [y]F -(144) F[ +(180) x]; |
118 |
F => f; |
119 |
) |
120 |
|
121 |
ruleset ( |
122 |
// by Philippe Hurbain |
123 |
// Same as AmmanPolyColor, showing only the |
124 |
// pentagon/hexagon tiling |
125 |
|
126 |
Ammann_poly(n) => attr (delta, 360/10) x, n; |
127 |
x => attr (distance, distance*0.618034) +(36) [ -(9) attr (distance, distance*0.66) F]f[ +(196.5) attr (distance, distance*0.363) F][ +(180) y] -(72) f[ +(180) x]; |
128 |
x => [ -(144) attr (distance, distance*0.618034) f attr (distance, distance/0.618034) x] -(108) [ -(36) attr (distance, distance*0.509) F attr (distance, distance*01.18) -(30) F][x]f[ -(153) attr (distance, distance*0.66) F] -(72) [y]f; |
129 |
y => attr (distance, distance*0.618034) +(72) [x][ -(36) attr (distance, distance*0.509) F]f -(144) [ -(9) attr (distance, distance*0.66) F]f[ +(180) y][ +(196.5) attr (distance, distance*0.363) F]; |
130 |
y => -(36) [y]f -(144) f[ +(180) x]; |
131 |
F => f; |
132 |
) |
133 |
|
134 |
ruleset ( |
135 |
// by Philippe Hurbain |
136 |
// Penrose's stars and pentagon tiling, generated as |
137 |
// a coloring of kites and darts |
138 |
|
139 |
Stars_pentas_color(n) => attr (delta, 360/20) k, n; |
140 |
k => ++[ attr (distance, distance*0.618034) [f- attr (distance, distance*0.5878) [F]------F F++++F]a]F attr (distance, distance*0.618034) ------; |
141 |
k => [--k]F--F------[--k] attr (distance, distance/0.618034) F[ attr (distance, distance*0.618034) |a]; |
142 |
a => [ attr (distance, distance*0.618034) k]++F attr (distance, distance*0.618034) [|[f attr (distance, distance*0.5878) +++++++F]a]--------F; |
143 |
a => ++F--------[f attr (distance, distance*0.5878) -------F][a] attr (distance, distance/0.618034) F; |
144 |
F => f; |
145 |
) |
146 |
|
147 |
ruleset ( |
148 |
// by Philippe Hurbain |
149 |
// Same as Stars&PentasColor, showing only coloring |
150 |
|
151 |
Stars_pentas(n) => attr (delta, 360/20) [k]++++[k]++++[k]++++[k]++++[k], n; |
152 |
k => ++[ attr (distance, distance*0.618034) [f- attr (distance, distance*0.5878) [F]------F F++++F]a]f attr (distance, distance*0.618034) ------; |
153 |
k => [--k]f--f------[--k] attr (distance, distance/0.618034) f[ attr (distance, distance*0.618034) |a]; |
154 |
a => [ attr (distance, distance*0.618034) k]++f attr (distance, distance*0.618034) [|[f attr (distance, distance*0.5878) +++++++F]a]--------f; |
155 |
a => ++f--------[f attr (distance, distance*0.5878) -------F][a] attr (distance, distance/0.618034) f; |
156 |
F => f; |
157 |
) |
158 |
|
159 |
|
160 |
ruleset ( |
161 |
// by Philippe Hurbain |
162 |
// Penrose's stars and pentagons, generated from |
163 |
// decomposition rules |
164 |
// u is the star, v is the boat, w is the thin rhombus |
165 |
// x, y and z are the pentagons |
166 |
|
167 |
Stars_pentas1(n) => attr (delta, 360/10) u, n; |
168 |
u => attr (distance, distance*0.381966) [v]F[|y][-u]++F|+[v]F[|y]++F|+[v]F[|y]++F|+; |
169 |
u => [v]F[|y]++F|+[v]F[|y]++F; |
170 |
v => attr (distance, distance*0.381966) [v]F[|y]++F|+[v]F[|y]-[u]F-F|+[v]F[|y]++F; |
171 |
w => attr (distance, distance*0.381966) f++[u]F|+F-F|+[v]F[|y]; |
172 |
y => attr (distance, distance*0.381966) [x][y][w]F[|!y]++F++[y][w]F[|!y]++F++[z]F; |
173 |
x => attr (distance, distance*0.381966) f++f++[!x][!z]F--[!z]F--[!z]F--[!z]F--[!z]F; |
174 |
z => attr (distance, distance*0.381966) [z][x]F++[z]F++[w][y]F[|!y]++F++[z]F; |
175 |
F => f; |
176 |
) |
177 |
|