Page 1 of 1

Resize but translate over fixed distance

Posted: Fri Jun 13, 2008 2:16 am
by pjdevries
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?

Posted: Sat Jun 14, 2008 10:15 pm
by MtnViewJohn
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:

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}
}
People often write Python scrips to generate tedious cfdg rules like this.

Posted: Sun Jun 15, 2008 11:16 pm
by pjdevries
Thanks for the reply. I thought as much. It is quite a restriction though. More control over translation distances would be quite a value added feature I think.

Posted: Thu Jun 26, 2008 7:18 pm
by sicvolo
pjdevries wrote:It is quite a restriction though.
Yeah. And it is that 'context free' part in 'context free art'.
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 {}