home *** CD-ROM | disk | FTP | other *** search
/ Hot Shareware 32 / hot34.iso / ficheros / DGRAF / FRAIN196.ZIP / PENROSE.L < prev    next >
Text File  |  1995-03-10  |  6KB  |  177 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 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. Penrose1 { ;; by Herb Savage
  16.            ;; based on Martin Gardner's "Penrose Tiles to Trapdoor Ciphers",
  17.            ;; Roger Penrose's rhombuses
  18.   Angle 10
  19.   Axiom +WF--XF---YF--ZF
  20.   W=YF++ZF----XF[-YF----WF]++
  21.   X=+YF--ZF[---WF--XF]+
  22.   Y=-WF++XF[+++YF++ZF]-
  23.   Z=--YF++++WF[+ZF++++XF]--XF
  24.   F=
  25. }
  26.  
  27. Losanges {
  28.            ;; by Philippe Hurbain
  29.            ;; Penrose's rhombuses, generated by decomposition rules
  30.            ;; x generate the fat rhombus, y the thin one
  31.            ;; Individualization of rhombuses allows easy coloring
  32.            ;; 0.618034 is ({5-1)/2
  33.   Angle 10
  34.   Axiom x
  35.   x=@.618034+f[|y]--f[|x][|+@.618034g@i.618034x]---[x]f--[y]f
  36.   y=@.618034++[x]f|+f[|y]-[y]f|+f[|x]
  37.   f=g
  38. }
  39.  
  40. PentaColor {
  41.              ;; by Philippe Hurbain
  42.              ;; Simple coloring of Penrose's rhombuses, showing pentagons
  43.   Angle 20
  44.   Axiom c04[x]++++[x]++++[x]++++[x]++++[x]
  45.   x=@.618034++f[c10@1.1755-------f][|y]----f[|x]
  46.   x=[|++@.618034g@i.618034x]------[x]f----[y]f
  47.   y=@.618034++++[x]f|++f[|y]--[y]f|++f[|x]
  48.   f=g
  49. }
  50.  
  51. Penta {
  52.         ;; by Philippe Hurbain
  53.         ;; Same as PentaColor, but showing only the coloring
  54.   Angle 20
  55.   Axiom [x]++++[x]++++[x]++++[x]++++[x]
  56.   x=@.618034++g[@1.1755-------f][|y]----g[|x]
  57.   x=[|++@.618034g@i.618034x]------[x]g----[y]g
  58.   y=@.618034++++[x]g|++g[|y]--[y]g|++g[|x]
  59.   f=g
  60. }
  61.  
  62.  
  63. Kites&Darts {
  64.               ;; by Philippe Hurbain
  65.               ;; Penrose's kites and darts
  66.               ;; k generates the kite, a generates the dart
  67.   Angle 10
  68.   Axiom k
  69.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  70.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  71.   f=g
  72. }
  73.  
  74. Kites&Darts2 {
  75.                ;; by Philippe Hurbain
  76.                ;; Penrose's kites and darts, with kites seed
  77.   Angle 10
  78.   Axiom [k]++[k]++[k]++[k]++[k]
  79.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  80.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  81.   f=g
  82. }
  83.  
  84. Kites&Darts3 {
  85.                ;; by Philippe Hurbain
  86.                ;; Penrose's kites and darts, with darts seed
  87.   Angle 10
  88.   Axiom [a]++[a]++[a]++[a]++[a]
  89.   k=+[@.618034a]f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  90.   a=[@.618034k]+f@.618034[|a]----f+f----[a]@i.618034f
  91.   f=g
  92. }
  93.  
  94. Kites&DartsColor {
  95.                    ;; by Philippe Hurbain
  96.                    ;; Penrose's kites and darts, with serpentine coloring
  97.   Angle 10
  98.   Axiom c4[k]++[k]++[k]++[k]++[k]
  99.   k=+[@.618034a[g---@.618c10f][--g+++@.618c10f]]
  100.   k=f@.618034---[-k]f-f---[-k]@i.618034f[@.618034|a]
  101.   a=[@.618034k]+f@.618034[|a][|g++@.382c10f]----f+
  102.   a=f----[a][g--@.382c10f]@i.618034f
  103.   f=g
  104. }
  105.  
  106.  
  107. AmmannPolyColor {  
  108.                   ;; by Philippe Hurbain
  109.                   ;; Ammann's coloring of Penrose's rhombuses, giving an
  110.                   ;; aperiodic tiling of 2 pentagons and 1 hexagon
  111.   Angle 10
  112.   Axiom c1x
  113.   x=@.618034/36[c3\9@.66D]D[c3/196.5@.363D][/180y]\72D[/180x]
  114.   x=[\144@.618034M@i.618034x]\108[c3\36@.509D@1.18\30D][x]D[c3\153@.66D]\72[y]D
  115.   y=@.618034/72[x][c3\36@.509D]D\144[c3\9@.66D]D[/180y][c3/196.5@.363D]
  116.   y=\36[y]D\144D[/180x]
  117.   D=M
  118. }
  119.  
  120. AmmannPoly {     
  121.              ;; by Philippe Hurbain
  122.              ;; Same as AmmanPolyColor, showing only the
  123.              ;; pentagon/hexagon tiling
  124.   Angle 10
  125.   Axiom x
  126.   x=@.618034/36[\9@.66D]M[/196.5@.363D][/180y]\72M[/180x]
  127.   x=[\144@.618034M@i.618034x]\108[\36@.509D@1.18\30D][x]M[\153@.66D]\72[y]M
  128.   y=@.618034/72[x][\36@.509D]M\144[\9@.66D]M[/180y][/196.5@.363D]
  129.   y=\36[y]M\144M[/180x]
  130.   D=M
  131. }
  132.  
  133. Stars&PentasColor {
  134.                 ;; by Philippe Hurbain
  135.                 ;; Penrose's stars and pentagon tiling, generated as
  136.                 ;; a coloring of kites and darts
  137.   Angle 20
  138.   Axiom c04k
  139.   k=++[@.618034[g-c10@.5878[f]------ff++++f]a]f@.618034------
  140.   k=[--k]f--f------[--k]@i.618034f[@.618034|a]
  141.   a=[@.618034k]++f@.618034[|[gc10@.5878+++++++f]a]--------f
  142.   a=++f--------[c10g@.5878-------f][a]@i.618034f
  143.   f=g
  144. }
  145.  
  146. Stars&Pentas1 {
  147.                 ;; by Philippe Hurbain
  148.                 ;; Same as Stars&PentasColor, showing only coloring
  149.   Angle 20
  150.   Axiom [k]++++[k]++++[k]++++[k]++++[k]
  151.   k=++[@.618034[g-@.5878[f]------ff++++f]a]g@.618034------
  152.   k=[--k]g--g------[--k]@i.618034g[@.618034|a]
  153.   a=[@.618034k]++g@.618034[|[g@.5878+++++++f]a]--------g
  154.   a=++g--------[g@.5878-------f][a]@i.618034g
  155.   f=g
  156. }
  157.  
  158.  
  159. Stars&Pentas2  {
  160.                  ;; by Philippe Hurbain
  161.                  ;; Penrose's stars and pentagons, generated from
  162.                  ;; decomposition rules
  163.                  ;; u is the star, v is the boat, w is the thin rhombus
  164.                  ;; x, y and z are the pentagons
  165.   Angle 10
  166.   Axiom u
  167.   u=@.381966[v]F[|y][-u]++F|+[v]F[|y]++F|+[v]F[|y]++F|+
  168.   u=[v]F[|y]++F|+[v]F[|y]++F
  169.   v=@.381966[v]F[|y]++F|+[v]F[|y]-[u]F-F|+[v]F[|y]++F
  170.   w=@.381966G++[u]F|+F-F|+[v]F[|y]
  171.   y=@.381966[x][y][w]F[|!y]++F++[y][w]F[|!y]++F++[z]F
  172.   x=@.381966G++G++[!x][!z]F--[!z]F--[!z]F--[!z]F--[!z]F
  173.   z=@.381966[z][x]F++[z]F++[w][y]F[|!y]++F++[z]F
  174.   F=G
  175. }
  176.  
  177.