What Links Here?
Penrose Tiling
A famous non-repeating tiling pattern, invented (discovered.) by Roger Penrose, a giant in the worlds of mathematics and floor-coverings.
The following logo program produces a penrose tiling. I found this at http://logo.twentygototen.org/E3_yJcQ4.
I haven't looked through it enough to understand it. I can only marvel at its wondrousness.
;; PENROSE TILING IN LOGO ;;
; Now with comments and constants, granted from
; actually looking at the syntax. Feel free to
; poke around.
;;;;;;;;;;;;;;;
;; CONSTANTS ;;
;;;;;;;;;;;;;;;
; Brush constants
make "kite_col [220 25 20]
make "dart_col [12 12 20]
make "pwidth 2
; Shape constants
make "startx 20
make "starty 480
make "size 10
make "detail 9
; Golden ratio
make "phi 1.61803399
make "phi_inv 0.61803399
;;;;;;;;;;;;;;;;;
;; SUBROUTINES ;;
;;;;;;;;;;;;;;;;;
;; DRAW A HALF-KITE, WITH DEFLATION ;;
to hkite :depth :dir
ifelse :depth > 1
[ ; Deflation case
; reduce recursion depth
make "depth :depth-1
; Draw components and return to origin
turn :dir 36
hdart :depth (not :dir)
turn (not :dir) 36
fw (power :phi :depth) * :size
rt 180
hkite :depth (not :dir)
turn (not :dir) 72
hkite :depth :dir
turn :dir 72
fw (power :phi :depth) * :size
rt 180
]
[ ; Base case
; Draw half kite and return to origin
pd
color :kite_col
fw :size
turn :dir 108
fw :size*:phi_inv
pu
turn :dir 108
fw :size
turn :dir 144
]
end
;; DRAW A HALF-DART, WITH DEFLATION ;;
to hdart :depth :dir
ifelse :depth > 1
[ ; Deflation case
; reduce recursion depth
make "depth :depth - 1
; Draw components and return to origin
hkite :depth :dir
fw (power :phi :depth) * :size
turn :dir 144
hdart :depth :dir
turn :dir 36
fw (power :phi :depth) * :size
rt 180
]
[ ; Base case
; Draw a half-dart
pd
color :dart_col
fw :size
turn :dir 144
fw :size*:phi_inv
pu
turn :dir 72
fw :size*:phi_inv
turn :dir 144
]
end
;; PARAMETRISED RT/LT ;;
to turn :dir :angle
ifelse :dir [rt :angle] [lt :angle]
end
;;;;;;;;;;;;;;;;;;
;; MAIN PROGRAM ;;
;;;;;;;;;;;;;;;;;;
reset
; Initialize
setxy :startx :starty
penwidth :pwidth
; Draw a single kite, deflating as required
hkite :detail true
rt 72
hkite :detail false