Recently I've been looking at Povray, pyprocessing, and cfdg (version 3.0) as tools for creating digital images. I have branched two separate blogs where I mainly explore jruby + processing and processing.py

Sunday, 18 October 2009

A More Complicated "Triangle" Tiling

A more complicated tiling pattern that I've also published on the context free gallery (you can download it there if you want to play with it yourself). Loses some the 632 rotational symmetry that Marcus du Sautoy was looking for, and found in the simpler example.

   1 startshape start
   2 
   3 size{s 6 6 x -2.5 y -3.5} // trim to hide the ragged edge
   4 
   5 background{b .6}
   6 
   7 rule start{
   8 10*{x .97}{
   9 10*{y .85 x -.48}{
  10 triangle{b .73 h 201 sat .8}
  11 hexagon{s .51 b 1 r 15} // tilt hexagon slightly
  12 hexastar{s .44 b .9 h 31 sat .8 x -.5 y .3}
  13 }
  14 } 
  15 }
  16 
  17 path triangle {  // revised version
  18     MOVETO {x -0.5 y (sin(-30) / sqrt(3))}
  19     3* {r 120} {
  20         CURVEREL {x 0.5 x1 0.25 y1 0.1}
  21         CURVEREL {x 0.5}
  22     }
  23     CLOSEPOLY {p align}
  24     FILL{}
  25 }
  26 
  27 path hexagon{
  28 MOVETO{x .25 y (sqrt(3)/4)}
  29 LINETO{x .5 y 0}
  30 LINETO{x .25 y (-sqrt(3)/4)}
  31 LINETO{x -.25 y (-sqrt(3)/4)}
  32 LINETO{x -.5 y 0}
  33 LINETO{x -.25 y (sqrt(3)/4)}
  34 CLOSEPOLY{}
  35 STROKE{width 0.01 b -1}
  36 FILL{}
  37 } 
  38 
  39 rule hexastar{
  40 TRIANGLE{r 90}
  41 TRIANGLE{r 270}
  42 }
 




Here is a more colorful variant with stronger curves. This is closer to a pattern that(see my attempted merger below), someone over on wikipedia has written, that may have been a source of inspiration for M C Escher:-

   1 startshape start
   2 
   3 size{s 6 6 x -2.5 y -3.5} // trim to hide the ragged edge
   4 
   5 background{b .6}
   6 
   7 rule start{
   8 10*{x .97}{
   9 10*{y .85 x -.48}{
  10 astar{s .35  x -.48 y .29}
  11 atile{z -1} // z -1 needed to force triangle below hexagon
  12 hexagon{s .4 b 1}
  13 }
  14 } 
  15 }
  16 rule atile{ // 4 different color ways, with equal weighting
  17 triangle{b .73 h 201 sat .53}
  18 }
  19 rule atile{
  20 triangle{b .53 h 42 sat .76}
  21 }
  22 rule atile{
  23 triangle{b .53 h 356 sat .7}
  24 }
  25 rule atile{
  26 triangle{b .68 h 132 sat .64}
  27 }
  28 rule astar{
  29 hexastar{b .9 h 31 sat .8}
  30 }
  31 rule astar{
  32 hexastar{b .53 h 356 sat .7}
  33 }
  34 path triangle {  // revised version
  35     MOVETO {x -0.5 y (sin(-30) / sqrt(3))}
  36     3* {r 120} {
  37         CURVEREL {x 0.5 x1 0.25 y1 0.3}
  38         CURVEREL {x 0.5}
  39     }
  40     CLOSEPOLY {p align}
  41     FILL{}
  42 }
  43 
  44 path hexagon{
  45 MOVETO{x .25 y (sqrt(3)/4)}
  46 LINETO{x .5 y 0}
  47 LINETO{x .25 y (-sqrt(3)/4)}
  48 LINETO{x -.25 y (-sqrt(3)/4)}
  49 LINETO{x -.5 y 0}
  50 LINETO{x -.25 y (sqrt(3)/4)}
  51 CLOSEPOLY{}
  52 STROKE{width 0.01 b -1}
  53 FILL{}
  54 } 
  55 
  56 rule hexastar{
  57 TRIANGLE{r 90}
  58 TRIANGLE{r 270}
  59 }
 


No comments:

Post a Comment

Followers

Blog Archive

About Me

My photo
Pembrokeshire, United Kingdom
I have developed JRubyArt and propane new versions of ruby-processing for JRuby-9.1.5.0 and processing-3.2.2