Primitive Shapes

John Horigan edited this page Mar 16, 2015 · 1 revision

Primitive Shapes

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

  • Squares are unit squares. If two squares are drawn one unit apart in x or y then that will be drawn edge-to-edge.
SQUARE [x 1 b 0.5]  // gray square right next to the black square
  • Circles are unit circles. They have the same diameter as the side of a square.
  • Triangles are unit triangles. The have the same side length as squares.
  • Fills draw on the entire canvas

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

shape 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]

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.