Resize but translate over fixed distance

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
pjdevries
Posts: 2
Joined: Fri Jun 13, 2008 1:59 am

Resize but translate over fixed distance

Post 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?

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post 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.

pjdevries
Posts: 2
Joined: Fri Jun 13, 2008 1:59 am

Post 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.

User avatar
sicvolo
Posts: 8
Joined: Sat May 03, 2008 12:08 am

Post 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 {}

Post Reply