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

Saturday, 12 June 2010

A Scheme Library For Context Free Art (I had to give it a go)

Ed Cavazos has produced a couple of Scheme implementations of cfdg here is the one I tried http://github.com/dharmatech/psilab/.

   1 ;Levy fractal
   2 ;By Martin Prout
   3 ;
   4 
   5 (import (psilab cfdg core)
   6         (psilab cfdg rule))
   7 
   8 (rule levy
   9   (1 (square (hue 0))
  10      (levy 
  11       (rotate 45) 
  12       (scale (/ 1 (sqrt 2)))
  13       (brightness 0.1)
  14       (saturation 0.1)
  15       (x 0.5)
  16      )
  17      (levy 
  18       (rotate -45) 
  19       (scale (/ 1 (sqrt 2)))
  20       (brightness 0.1)
  21       (saturation 0.1)
  22       (x 0.5)
  23      )      
  24    )
  25 )
  26 
  27 
  28 (init-cfdg)
  29 
  30 (background (brightness -1))
  31 
  32 (bounds -1.2 1.2 -1.2 1.2)
  33 
  34 (start-shape levy) 



I reckon the reason for the missing bits on the levy curve is that the probability of the recursive levy are shared with the square. So far my experiments to sort it out, have caused a syntax error. Update 14 June, Ed Cavazos let me know, via the cfdg discourse, that the problem is that first recursive levy dominates. Which is interesting as it highlights a difference between the Scheme expansion and the C++ implementation of the rules. Makes me wonder what happens with ruby processing? I should have remembered it worked OK see my ruby-processing blog.

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