missing expressions?

If you're having trouble using Context Free or don't understand the language, ask for help here.

Moderators: MtnViewJohn, chris, mtnviewmark

Post Reply
jdobres
Posts: 3
Joined: Mon Jul 07, 2008 6:58 pm

missing expressions?

Post by jdobres »

Hi there! New, highly enthusiastic user here. I was perusing the wiki and noticed that CFDG is supposed to be capable of doing math, ie, 4 - 2, sin(10), etcetera. However, my version of CF doesn't seem to be able to process these expression. I'm using the most recent Mac OS version. Am I missing something here?

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

Post by MtnViewJohn »

Math expressions are a feature of the version 2.2 beta. You can download it here. I will release v2.2 as soon as I figure out why round-caps are broken.

jdobres
Posts: 3
Joined: Mon Jul 07, 2008 6:58 pm

Post by jdobres »

Ah, I figured it was something straightforward like that.

Is there any way to alter the way in which expression are evaluated? For instance, given the command:

Code: Select all

10 * {x 1 y sin(1)} CIRCLE {}
CF moves each circle right by 1 and up by sin(1) on each loop iteration. Is there any way to make it such that the term inside sin( ) is incremented on each iteration of the loop, rather than simply evaluating sin(x) once and using that value for all iterations? This would allow some pretty interesting shapes to be created easily. :-)

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

Post by MtnViewJohn »

jdobres wrote:Ah, I figured it was something straightforward like that.

Is there any way to alter the way in which expression are evaluated? For instance, given the command:

Code: Select all

10 * {x 1 y sin(1)} CIRCLE {}
CF moves each circle right by 1 and up by sin(1) on each loop iteration. Is there any way to make it such that the term inside sin( ) is incremented on each iteration of the loop, rather than simply evaluating sin(x) once and using that value for all iterations? This would allow some pretty interesting shapes to be created easily. :-)
In Context Free 2.2 the expressions are limited to constant values. In Context Free 3 you will be able to put rule parameters and loop index variables in expressions.

jdobres
Posts: 3
Joined: Mon Jul 07, 2008 6:58 pm

Post by jdobres »

Looking forward to it!

Post Reply