More basic shapes

Let the developers know what you think of the software and what can be done to either improve the CFDG language or the Context Free program.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
Music2000
Posts: 26
Joined: Mon Oct 10, 2005 3:38 pm
Location: London

More basic shapes

Post by Music2000 »

Hi i recently found Context Free and i think its a great program, being a new user i am not yet able to code very complex things so what i find best at the moment is modifying the examples from the gallery and replacing SQUARE with TRIANGLE and changing values. As far as i know theres only 3 shapes at the moment but with only these 3 theres already a huge amount of options available so how about adding some more of these shapes, i was thinking a Hexagon and diamond would be cool.

Also maybe add the option to modify with SIN COS TAN ect which would also allow for alot more cool things, hope you like my ideas, thanks :)

User avatar
MtnViewJohn
Site Admin
Posts: 882
Joined: Fri May 06, 2005 2:26 pm
Location: Mountain View, California
Contact:

Post by MtnViewJohn »

We are thinking of allowing for more complex static expressions. But in the mean time you should experiment with the [] syntax:

Code: Select all

startshape foo

rule foo {
	CIRCLE {}
	TRIANGLE { r 30 x 5 }
	TRIANGLE [ r 30 x 5 ]
	TRIANGLE [ r 30 x 7 r 30 ]
}
The original {} syntax ignores the order of the transformations in the cfdg file and does them in a fixed order: translate (x & y), size, rotate, skew, and flip (if any).

The [] syntax does the opposite: transforms are applied in the order that they are in the cfdg file. The second TRIANGLE in the example rotates the coordinate system 30° and then translates 5 units on the x axis in the rotated coordinate system. The 3rd TRIANGLE does a 2nd coordinate space rotation after the translation.

This is not as versatile as have generalized expressions with trig functions. But being able to put the rotation before the translation eliminates some of the reasons for needing trig functions.

Post Reply