Friday, February 20, 2009
Project #50 - Context Free Art
I've been playing with a wonderful graphics rendering engine called Context Free Art. Instead of drawing images by hand this program takes programmed rules and uses them to render figures of amazing elegance and beauty. The rules are even written in a Context Free Design Grammar, which warms my computational linguist heart.
Wikipedia has a pretty good article on CFGs here. In summary, a CFG is made up of a series of production rules. The left hand side of the rule a series of one or more terminals [usually letters or words when applied to natural languages] and/or a non-terminal [a.k.a. the right-hand side of a rule]. When a non-terminals are rewritten without regard for the rule they came from, hence 'context-free'. That explanation probably made no sense, so ignore me and read the Wikipedia article.
Best of all, there program is free and will work on almost any computer. Even underpowered my mini laptop tore through complex images with little delay.

There are even free examples that come with the program for those who feel daunted by the abstract looking commands. The tree above comes as one of the examples, though I tweaked the shading.
Here are two images that I put together after playing with CFA for a few minutes, plus the rules required to render them.

startshape COILS
rule COILS {
4*{r 90}COIL_CIRCLE {}
}
rule COIL_CIRCLE {
COIL_CIRCLE { s .85 r -35 y -0.5 x 0.75}
CIRCLE{}
}

startshape COILS
rule COILS {
5* {r 75} COIL_CIRCLE {}
#COIL_CIRCLE {}
}
rule COIL_CIRCLE {
COIL_CIRCLE { s .99 r 20 b 0.01 y -0.9 x 0.5 }
CIRCLE{}
}
This stuff is perfect for backgrounds on cards or invitations, especially for math nerds.Labels: coding, projects
posted by Alison 2/20/2009 07:38:00 PM
:
(0) comments :
splink
|