I just stumbled on Context Free and played with it for a while. It's a cool piece of software, although I have to admit that I don't grasp all the in's and out's yet.
Currently I'm stuck on something which appears to be easy to accomplish with Context Free, but might not even be possible. I'm trying to generate a 'pile' of circles, which gradually decrease in size but have their centres at equal, fixed distances from one another. Is that possible and if yes, how?
Resize but translate over fixed distance
Moderators: MtnViewJohn, chris, mtnviewmark
- MtnViewJohn
- Site Admin
- Posts: 882
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
You can't do this using a recursive rule because the only way to shrink the circles is to shrink the coordinate space, using the size adjustment. But this also shrinks the distances between the circles. The only way to do this is to explicitly draw each circle: People often write Python scrips to generate tedious cfdg rules like this.
Code: Select all
rule Circles {
CIRCLE {x 0 s 1.0}
CIRCLE {x 1 s 0.9}
CIRCLE {x 2 s 0.8}
CIRCLE {x 3 s 0.7}
CIRCLE {x 4 s 0.6}
CIRCLE {x 5 s 0.5}
CIRCLE {x 6 s 0.4}
CIRCLE {x 7 s 0.3}
CIRCLE {x 8 s 0.2}
CIRCLE {x 9 s 0.1}
}
Yeah. And it is that 'context free' part in 'context free art'.pjdevries wrote:It is quite a restriction though.
You can't carry knowledge this from one context to another.
Try loops in the same context to achieve what you want .
Code: Select all
10 *{x 1 s .9} CIRCLE {}