Context Free Art

Startshape directive

From Context Free Art

Jump to: navigation, search

The Startshape Directive

CFDG files are mostly just a collection of shape rules for generating shapes, but Context Free/CFDG needs to know which shape to start with. The startshape directive does this. A startshape directive is simply a line in the CFDG file that begins with the word startshape followed by the name of the shape to start with. Context Free/CFDG begins the rendering process by picking one of the rules for that named shape and rendering it with the following characteristics:

For example:

startshape JustACirclePlease
 
rule JustACirclePlease {
    CIRCLE {}
}

Having Multiple Startshape Directives

CFDG files can have multiple startshape directives and only the first will be used. It doesn't really make sense to have multiple startshape directives in one file. But what does make sense is for included CFDG files to have a startshape directive that is ignored when it is included but used when it is by itself. This allows you to include another design and use some of its rules. This also lets you have a test rule for testing a library of rules like i_pix.cfdg or i_polygons.cfdg.

Views
Personal tools
Navigation
Toolbox
MediaWiki
Attribution-Share Alike 2.5
book coverSee our new book:
Community of Variation