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

Tuesday, 8 September 2009

Pentaflake Colorful Variant

A hue of 220 is blue, a hue of 360 is red (color mode "HSB").

   1 startshape pentaflake
   2 background {h 220 sat 0.5 b 0.1 }
   3 
   4 rule pentaflake{
   5     pentagon {} 
   6     5 * { r 72 } pentaflake { h -.8 sat .3 b .8 s .378 y .612 r 72 }  
   7 }
   8 
   9 path pentagon{
  10 MOVETO{x 0 y 1}
  11 LINETO{x (-.25*sqrt(10 + (2*sqrt(5)))) y (.25*(sqrt(5) - 1))}
  12 LINETO{x (-.25*sqrt(10 - (2*sqrt(5)))) y (-.25*(sqrt(5) + 1))}
  13 LINETO{x (.25*sqrt(10 - (2*sqrt(5)))) y (-.25*(sqrt(5) + 1))}
  14 LINETO{x (.25 * sqrt(10 + (2  * sqrt(5)))) y (.25 * (sqrt(5) - 1))}
  15 CLOSEPOLY{}
  16 FILL{h 360 b .2}
  17 STROKE{width .01 b -1}
  18 } 
  19 
  20 

Here I have used the fill path command to make the enclosed polygon behave more like the primitive shapes, circle,square & triangle.

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