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, 11 October 2009

Floor Tiles?

There seemed to be a of a conceit over at the context free wiki that you don't need Math to write context free rules, and there are a lot of magic numbers used (whether that helps the processor or not I'm unsure). However more "artists" are coming out these days and putting in comments that explain where the "magic" numbers come from.
I'm beginning to see the point of of the magic numbers though, because the current syntax leads to a lot of nasty brackets. I now seem to be having a bit more success in applying the size directive, which is essential for editing out the ragged edges of images such as those produced by this set of rules.

   1 startshape start
   2 
   3 size{s 7 7 x -4 y -4.33}
   4 
   5 rule start{
   6 6*{y 1.732}  // 1.732 ~ sqrt(3)
   7 {
   8 chevleft{h 360 sat .4}
   9 chevright{y .866 h 360 sat .5} // .866 ~ sqrt(3)/2
  10 }
  11 }
  12 
  13 rule chevleft{
  14 9*{x 1}{
  15 chevron{b .8}
  16 chevron{b .7 x 0.5}
  17 }
  18 }
  19 
  20 rule chevright{
  21 9*{x 1}{
  22 chevron{b .85 flip 90 b .75}
  23 chevron{b .7 x 0.5 flip 90 b .65}
  24 }
  25 }
  26 
  27 path chevron{
  28 MOVETO{x .25 y 0.433} // 0.433 ~ sqrt(3)/4
  29 LINETO{x .5 y 0}
  30 LINETO{x .25 y -0.433}
  31 LINETO{x -.25 y -0.433}
  32 LINETO{x 0 y 0}
  33 LINETO{x -.25 y 0.433}
  34 CLOSEPOLY{}
  35 STROKE{width 0.03 b -1} 
  36 FILL{}
  37 }


 

1 comment:

  1. This is beautiful! The neutrals are so soothing and the variation of the tile makes a real impact. Wonderful job!
    Hexagonal floor Tile

    ReplyDelete

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