Context Free Art

Primitive shapes

From Context Free Art

Jump to: navigation, search

Primitive Shapes

Ultimately the only shape that Context Free/CFDG knows how to draw are squares, circles, and triangles. Whenever CF encounters a primitive shape in a shape rule it draws it immediately. The sizes of these three shapes are:

SQUARE {}
SQUARE {x 1 b 0.5}  // gray square right next to the black square

Here is what the primitive shapes look like with respect to each other:

rule foo {
    SQUARE {}
    CIRCLE {b 1}
 
    SQUARE {x 1.5}
    TRIANGLE {b 0.5 x 1.5}
 
    SQUARE {x 3}
    CIRCLE {b 1 x 3}
    TRIANGLE {b 0.5 x 3}
}

Image:shape_demo.png

As a guide for manipulating shapes in Context Free/CFDG, the following illustration highlights some key coordinates—relative to the current transformation matrix—of the SQUARE, CIRCLE, and TRIANGLE primitives:

Coordinates of CF primitives

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