home *** CD-ROM | disk | FTP | other *** search
/ Fractal Creations (Second Edition) / FRACTALS_2E.iso / finstall.exe / PENROSE.L < prev    next >
Text File  |  1992-07-10  |  5KB  |  178 lines

  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 Grünbaum 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. Penrose1 {
  16.            ;; by Herb Savage
  17.            ;; based on Martin Gardner's "Penrose Tiles to Trapdoor Ciphers",
  18.            ;; Roger Penrose's rhombuses
  19.   Angle 10
  20.   Axiom +WF--XF---YF--ZF
  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. Losanges {
  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.   Angle 10
  35.   Axiom x
  36.   x=@.618034+f[|y]--f[|x][|+@.618034g@i.618034x]---[x]f--[y]f
  37.   y=@.618034++[x]f|+f[|y]-[y]f|+f[|x]
  38.   f=g
  39. }
  40.  
  41. PentaColor {
  42.              ;; by Philippe Hurbain
  43.              ;; Simple coloring of Penrose's rhombuses, showing pentagons
  44.   Angle 20
  45.   Axiom c04[x]++++[x]++++[x]++++[x]++++[x]
  46.   x=@.618034++f[c10@1.1755-------f][|y]----f[|x]
  47.   x=[|++@.618034g@i.618034x]------[x]f----[y]f
  48.   y=@.618034++++[x]f|++f[|y]--[y]f|++f[|x]
  49.   f=g
  50. }
  51.  
  52. Penta {
  53.         ;; by Philippe Hurbain
  54.         ;; Same as PentaColor, but showing only the coloring
  55.   Angle 20
  56.   Axiom [x]++++[x]++++[x]++++[x]++++[x]
  57.   x=@.618034++g[@1.1755-------f][|y]----g[|x]
  58.   x=[|++@.618034g@i.618034x]------[x]g----[y]g
  59.   y=@.618034++++[x]g|++g[|y]--[y]g|++g[|x]
  60.   f=g
  61. }
  62.  
  63.  
  64. Kites&Darts {
  65.               ;; by Philippe Hurbain
  66.               ;; Penrose's kites and darts
  67.               ;; k generates the kite, a generates the dart
  68.   Angle 10
  69.   Axiom k
  70.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  71.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  72.   f=g
  73. }
  74.  
  75. Kites&Darts2 {
  76.                ;; by Philippe Hurbain
  77.                ;; Penrose's kites and darts, with kites seed
  78.   Angle 10
  79.   Axiom [k]++[k]++[k]++[k]++[k]
  80.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  81.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  82.   f=g
  83. }
  84.  
  85. Kites&Darts3 {
  86.                ;; by Philippe Hurbain
  87.                ;; Penrose's kites and darts, with darts seed
  88.   Angle 10
  89.   Axiom [a]++[a]++[a]++[a]++[a]
  90.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  91.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  92.   f=g
  93. }
  94.  
  95. Kites&DartsColor {
  96.                    ;; by Philippe Hurbain
  97.                    ;; Penrose's kites and darts, with serpentine coloring
  98.   Angle 10
  99.   Axiom c4[k]++[k]++[k]++[k]++[k]
  100.   k=+[@.618034a[g---@.618c10f][--g+++@.618c10f]]
  101.   k=f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  102.   a=[@.618034k]+f@.618034[|a][|g++@.382c10f]----f+
  103.   a=f----[a][g--@.382c10f]@i.618034f
  104.   f=g
  105. }
  106.  
  107.  
  108. AmmannPolyColor {
  109.                   ;; by Philippe Hurbain
  110.                   ;; Ammann's coloring of Penrose's rhombuses, giving an
  111.                   ;; aperiodic tiling of 2 pentagons and 1 hexagon
  112.   Angle 10
  113.   Axiom c1x
  114.   x=@.618034/36[c3\9@.66D]D[c3/196.5@.363D][/180y]\72D[/180x]
  115.   x=[\144@.618034M@i.618034x]\108[c3\36@.509D@1.18\30D][x]D[c3\153@.66D]\72[y]D
  116.   y=@.618034/72[x][c3\36@.509D]D\144[c3\9@.66D]D[/180y][c3/196.5@.363D]
  117.   y=\36[y]D\144D[/180x]
  118.   D=M
  119. }
  120.  
  121. AmmannPoly {
  122.              ;; by Philippe Hurbain
  123.              ;; Same as AmmanPolyColor, showing only the
  124.              ;; pentagon/hexagon tiling
  125.   Angle 10
  126.   Axiom x
  127.   x=@.618034/36[\9@.66D]M[/196.5@.363D][/180y]\72M[/180x]
  128.   x=[\144@.618034M@i.618034x]\108[\36@.509D@1.18\30D][x]M[\153@.66D]\72[y]M
  129.   y=@.618034/72[x][\36@.509D]M\144[\9@.66D]M[/180y][/196.5@.363D]
  130.   y=\36[y]M\144M[/180x]
  131.   D=M
  132. }
  133.  
  134. Stars&PentasColor {
  135.                 ;; by Philippe Hurbain
  136.                 ;; Penrose's stars and pentagon tiling, generated as
  137.                 ;; a coloring of kites and darts
  138.   Angle 20
  139.   Axiom c04k
  140.   k=++[@.618034[g-c10@.5878[f]------ff++++f]a]f@.618034------
  141.   k=[--k]f--f------[--k]@i.618034f[@.618034|a]
  142.   a=[@.618034k]++f@.618034[|[gc10@.5878+++++++f]a]--------f
  143.   a=++f--------[c10g@.5878-------f][a]@i.618034f
  144.   f=g
  145. }
  146.  
  147. Stars&Pentas1 {
  148.                 ;; by Philippe Hurbain
  149.                 ;; Same as Stars&PentasColor, showing only coloring
  150.   Angle 20
  151.   Axiom [k]++++[k]++++[k]++++[k]++++[k]
  152.   k=++[@.618034[g-@.5878[f]------ff++++f]a]g@.618034------
  153.   k=[--k]g--g------[--k]@i.618034g[@.618034|a]
  154.   a=[@.618034k]++g@.618034[|[g@.5878+++++++f]a]--------g
  155.   a=++g--------[g@.5878-------f][a]@i.618034g
  156.   f=g
  157. }
  158.  
  159.  
  160. Stars&Pentas2  {
  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.   Angle 10
  167.   Axiom u
  168.   u=@.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=@.381966[v]F[|y]++F|+[v]F[|y]-[u]F-F|+[v]F[|y]++F
  171.   w=@.381966G++[u]F|+F-F|+[v]F[|y]
  172.   y=@.381966[x][y][w]F[|!y]++F++[y][w]F[|!y]++F++[z]F
  173.   x=@.381966G++G++[!x][!z]F--[!z]F--[!z]F--[!z]F--[!z]F
  174.   z=@.381966[z][x]F++[z]F++[w][y]F[|!y]++F++[z]F
  175.   F=G
  176. }
  177.  
  178.