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, 6 August 2009

Towards a Mondrian

Here is my latest approach towards a Mondrian in context free, based on a set of boxes, some with sides that approximate to 'golden ratio'. White box is a box with no fill, if you try and specify brightness and sat, it will get colored... one of the quirks of context free. The 0.005 adjustment corresponds to half the default 10% stroke width if that makes sense to you.

   1 startshape mondrian 
2
3 rule mondrian {
4 white_box{}
5 yellow_box{y 1.005}
6 red_box{x 1.005}
7 blue_box{y 1.005 x 1.005}
8 }
9
10 path red_box {
11 FILL{brightness 1 hue 360 sat 1}
12 MOVETO{x 0.5 y 0.809}
13 LINETO{x -0.5 y 0.809}
14 LINETO{x -0.5 y -0.809}
15 LINETO{x 0.5 y -0.809}
16 CLOSEPOLY{}
17 STROKE{}
18 }
19 path white_box{
20 MOVETO{x 0.5 y 0.809}
21 LINETO{x -0.5 y 0.809}
22 LINETO{x -0.5 y -0.809}
23 LINETO{x 0.5 y -0.809}
24 CLOSEPOLY{}
25 STROKE{}
26 }
27 path yellow_box {
28 FILL{brightness 1 hue 60 sat 1}
29 MOVETO{x 0.5 y 0.5}
30 LINETO{x -0.5 y 0.5}
31 LINETO{x -0.5 y 0.25}
32 LINETO{x -0.5 y -0.25}
33 LINETO{x 0.5 y -0.25}
34 CLOSEPOLY{}
35 STROKE{}
36 }
37 path blue_box {
38 FILL{brightness 1 hue 220 sat 1}
39 MOVETO{x 0.5 y 0.5}
40 LINETO{x -0.5 y 0.5}
41 LINETO{x -0.5 y -0.5}
42 LINETO{x 0.5 y -0.5}
43 CLOSEPOLY{}
44 STROKE{}
45 }


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