A design is a set of shapes and the rules that draw them. Rendering starts from the startshape. Each rule draws primitives (CIRCLE, SQUARE, TRIANGLE) and calls other shapes, often itself.
startshape SPIRAL
shape SPIRAL {
CIRCLE [ ]
SPIRAL [ y 1.2 s 0.95 r 12 ]
}
The part in [ ] is an adjustment, applied to the shape before it is drawn: x and y move, s scales, r rotates (degrees), flip mirrors, skew shears. Colour is h (hue), sat, b (brightness) and a (alpha). Use [[ ]] to apply the parts in the order you write them.
The recursion stops by itself: when a shape gets smaller than about 0.3 pixel, the renderer drops it. That is why a rule can call itself with s 0.95 and still finish.
A shape can have more than one rule. Each time it is drawn, one rule is picked at random, by weight:
shape BRANCH
rule 9 { SQUARE [ ] BRANCH [ y 1 s 0.97 r 3 ] }
rule 1 { BRANCH [ r 30 ] BRANCH [ r -30 flip 90 ] }
The variation code (A to ZZZ) seeds every random pick, so the same code always gives the same picture. New variation picks a new code.
More: loop 12 [ r 30 ] { … } repeats with a growing adjustment; path draws your own outlines with MOVETO, LINETO, ARCTO, then FILL or STROKE; CF::Background = [ b -1 ] sets a black background; CF::Tile = [ s 10 ] makes a tiled design; CF::Time with ftime() makes an animation.
The full language: the Context Free wiki: rules, adjustments, primitives, paths, loops and if, expressions, CF:: settings, tiles. Thousands of designs by other people are in the contextfreeart.org gallery.