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: ,

posted by Alison 2/20/2009 07:38:00 PM : (0) comments : splink



prime-number.com

site feed

Archives:

Powered by Blogger



www.flickr.com
This is a Flickr badge showing items in a set called DIY. Make your own badge here.


My Rules for the year:
• Make something new every day.
• Don't buy anything you can make yourself, especially clothes.

Elsewhere:
Bio
Graphics Homework
Pictures
Email Me

Very Old Flash Homework:
Old Flash Page
Aquarium
KiteBuilder
Shapes

I belong to:
WeddingBee
Metafilter

Weblogs Written By Nice People:
» Munsoned in the Middle of Nowhere
» Ben Bonetti
» romej.com
» The Rector's Page
» A Dress A Day
» The Point of Babette

Old Versions:
Fall Leaves
Early to Rise
Chopstick
Equine


Old Splash Pages:
Old Splash Pages:
»Original Recipe
»Sketch of Clark
»Big Blob
»Another Big Blob
»Digi Charat Bear
»Linoleum Samples




Google



Search WWW
Search www.prime-number.com



Current Weather in Pittsburgh, PA: The WeatherPixie