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

Thursday, 17 June 2010

A Window on Ypsilon Scheme (context free)

Get the Scheme context free library here.

   1 ;A Window on Ypsilon Scheme
   2 ;By Martin Prout
   3 ;
   4 
   5 (import (psilab cfdg core)
   6         (psilab cfdg rule))
   7 
   8 (define Y_TOP (/ 0.5 (sqrt 3)))
   9 (define Y_BOT (/ (sqrt 3) -24))
  10 
  11 (rule unit
  12    (1 (triangle (brightness 0.5) (hue 180) (saturation 0.5))
  13       (unit       
  14       (scale 0.5) 
  15       (y Y_TOP)
  16       (brightness 0.2)
  17       (saturation 0.1)
  18       )
  19       (unit       
  20       (scale 0.5) 
  21       (x -0.25)
  22       (y Y_BOT)
  23       (brightness 0.2)
  24       (saturation 0.1)
  25       )
  26       (unit       
  27       (scale 0.5) 
  28       (x 0.25)
  29       (y Y_BOT)
  30       (brightness 0.2)
  31       (saturation 0.1)
  32       )
  33    )
  34 )   
  35 
  36 (init-cfdg)
  37 
  38 (background (hue 60) (brightness 1) (saturation 1)) 
  39 
  40 (bounds -0.5 0.5 -0.4 0.6)
  41 
  42 (start-shape unit) 


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