-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpenrose.l
176 lines (155 loc) · 5.33 KB
/
penrose.l
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
; Generation of Penrose aperiodic tilings
; Thanks to Herb Savage, who showed it was possible to generate those tilings
; with L-systems and Fractint.
; Based on decomposition of tilings described in Tilings and Pattern, by
; Branko Grunbaum and G.C. Shepard, W.H. Freeman and Company, chapter 10
; Philippe Hurbain
; 49 rue Jules Fossier
; 95380 LOUVRES
; FRANCE
Penrose1 { ;; by Herb Savage
;; based on Martin Gardner's "Penrose Tiles to Trapdoor Ciphers",
;; Roger Penrose's rhombuses
Angle 10
Axiom +WF--XF---YF--ZF
W=YF++ZF----XF[-YF----WF]++
X=+YF--ZF[---WF--XF]+
Y=-WF++XF[+++YF++ZF]-
Z=--YF++++WF[+ZF++++XF]--XF
F=
}
Losanges {
;; by Philippe Hurbain
;; Penrose's rhombuses, generated by decomposition rules
;; x generate the fat rhombus, y the thin one
;; Individualization of rhombuses allows easy coloring
;; 0.618034 is ({5-1)/2
Angle 10
Axiom x
[email protected]+f[|y]--f[|x][|[email protected]@i.618034x]---[x]f--[y]f
[email protected]++[x]f|+f[|y]-[y]f|+f[|x]
f=g
}
PentaColor {
;; by Philippe Hurbain
;; Simple coloring of Penrose's rhombuses, showing pentagons
Angle 20
Axiom c04[x]++++[x]++++[x]++++[x]++++[x]
[email protected]++f[[email protected]][|y]----f[|x]
x=[|[email protected]@i.618034x]------[x]f----[y]f
[email protected]++++[x]f|++f[|y]--[y]f|++f[|x]
f=g
}
Penta {
;; by Philippe Hurbain
;; Same as PentaColor, but showing only the coloring
Angle 20
Axiom [x]++++[x]++++[x]++++[x]++++[x]
[email protected]++g[@1.1755-------f][|y]----g[|x]
x=[|[email protected]@i.618034x]------[x]g----[y]g
[email protected]++++[x]g|++g[|y]--[y]g|++g[|x]
f=g
}
Kites&Darts {
;; by Philippe Hurbain
;; Penrose's kites and darts
;; k generates the kite, a generates the dart
Angle 10
Axiom k
k=+[@.618034a][email protected][-k]f-f---[-k]@i.618034f[@.618034|a]
a=[@.618034k][email protected][|a]----f+f----[a]@i.618034f
f=g
}
Kites&Darts2 {
;; by Philippe Hurbain
;; Penrose's kites and darts, with kites seed
Angle 10
Axiom [k]++[k]++[k]++[k]++[k]
k=+[@.618034a][email protected][-k]f-f---[-k]@i.618034f[@.618034|a]
a=[@.618034k][email protected][|a]----f+f----[a]@i.618034f
f=g
}
Kites&Darts3 {
;; by Philippe Hurbain
;; Penrose's kites and darts, with darts seed
Angle 10
Axiom [a]++[a]++[a]++[a]++[a]
k=+[@.618034a][email protected][-k]f-f---[-k]@i.618034f[@.618034|a]
a=[@.618034k][email protected][|a]----f+f----[a]@i.618034f
f=g
}
Kites&DartsColor {
;; by Philippe Hurbain
;; Penrose's kites and darts, with serpentine coloring
Angle 10
Axiom c4[k]++[k]++[k]++[k]++[k]
k=+[@.618034a[[email protected]][[email protected]]]
[email protected][-k]f-f---[-k]@i.618034f[@.618034|a]
a=[@.618034k][email protected][|a][|[email protected]]----f+
a=f----[a][[email protected]]@i.618034f
f=g
}
AmmannPolyColor {
;; by Philippe Hurbain
;; Ammann's coloring of Penrose's rhombuses, giving an
;; aperiodic tiling of 2 pentagons and 1 hexagon
Angle 10
Axiom c1x
x=[\[email protected]@i.618034x]\108[c3\[email protected]@1.18\30D][x]D[c3\[email protected]]\72[y]D
[email protected]/72[x][c3\[email protected]]D\144[c3\[email protected]]D[/180y][c3/[email protected]]
y=\36[y]D\144D[/180x]
D=M
}
AmmannPoly {
;; by Philippe Hurbain
;; Same as AmmanPolyColor, showing only the
;; pentagon/hexagon tiling
Angle 10
Axiom x
y=\36[y]M\144M[/180x]
D=M
}
Stars&PentasColor {
;; by Philippe Hurbain
;; Penrose's stars and pentagon tiling, generated as
;; a coloring of kites and darts
Angle 20
Axiom c04k
k=++[@.618034[[email protected][f]------ff++++f]a][email protected]
k=[--k]f--f------[--k]@i.618034f[@.618034|a]
a=[@.618034k][email protected][|[[email protected]+++++++f]a]--------f
a=++f--------[[email protected]][a]@i.618034f
f=g
}
Stars&Pentas1 {
;; by Philippe Hurbain
;; Same as Stars&PentasColor, showing only coloring
Angle 20
Axiom [k]++++[k]++++[k]++++[k]++++[k]
k=++[@.618034[[email protected][f]------ff++++f]a][email protected]
k=[--k]g--g------[--k]@i.618034g[@.618034|a]
a=[@.618034k][email protected][|[[email protected]+++++++f]a]--------g
a=++g--------[[email protected]][a]@i.618034g
f=g
}
Stars&Pentas2 {
;; by Philippe Hurbain
;; Penrose's stars and pentagons, generated from
;; decomposition rules
;; u is the star, v is the boat, w is the thin rhombus
;; x, y and z are the pentagons
Angle 10
Axiom u
[email protected][v]F[|y][-u]++F|+[v]F[|y]++F|+[v]F[|y]++F|+
u=[v]F[|y]++F|+[v]F[|y]++F
[email protected][v]F[|y]++F|+[v]F[|y]-[u]F-F|+[v]F[|y]++F
[email protected]++[u]F|+F-F|+[v]F[|y]
[email protected][x][y][w]F[|!y]++F++[y][w]F[|!y]++F++[z]F
[email protected]++G++[!x][!z]F--[!z]F--[!z]F--[!z]F--[!z]F
[email protected][z][x]F++[z]F++[w][y]F[|!y]++F++[z]F
F=G
}