Page 1 of 1

missing expressions?

Posted: Mon Jul 07, 2008 7:03 pm
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?

Posted: Tue Jul 08, 2008 3:29 am
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.

Posted: Tue Jul 08, 2008 8:36 am
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. :-)

Posted: Wed Jul 09, 2008 8:31 pm
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.

Posted: Thu Jul 10, 2008 10:15 am
by jdobres
Looking forward to it!