Page 2 of 2

Re: Version 3 alpha is available

Posted: Sat Jun 25, 2011 8:20 am
by Monkstone
Ignore bit about Size directive in previous post I just found out direction needs to be explicit, still issue with crop, and CF version numbering.

Re: Version 3 alpha is available

Posted: Sat Jun 25, 2011 4:55 pm
by MtnViewJohn
It works on my system. What happens when you render it?

Re: Version 3 alpha is available

Posted: Sat Jun 25, 2011 10:51 pm
by Monkstone
Well for this design for example, with the -c flag on command line but without the CF:SIze directive, the "sphere" is about half the expected size
/home/tux/CF3/cfdg -c -o pascal.png pascal.cfdg

startshape go

CF::Size = [s 1.0 x 0 y 0]

shape go{
loop i = 0.5, 14 [s 1]{
CIRCLE[b (mod(i - .5, 2)) s 1 (1 - i/14)]
CIRCLE[b (mod(i - .5, 2)) s (1 - i/14) 1]
}
}

(V12) was updated OK by the way (apologies for that, a bit of a version control issue at my end).

Re: Version 3 alpha is available

Posted: Sun Jun 26, 2011 8:28 am
by MtnViewJohn
Without the CF::Size Context Free dynamically sizes the image so that it fits in the drawing canvas with a blank border. The width of this border is part dynamic and part fixed. The fixed part is 8 pixels. The dynamic part is half the size of the largest shape closest to the edge in question. So your circles are shrinking to make room for a freakishly large dynamic border. You can suppress the dynamic part by saying

Code: Select all

cfdg -b 1 blahblahblah
and suppress the fixed and dynamic border with

Code: Select all

cfdg -b 0 blahblahblah
There will be a way for the cfdg file to suppress the border.

Re: Version 3 alpha is available

Posted: Mon Jun 27, 2011 2:16 pm
by imposeren

Re: Version 3 alpha is available

Posted: Tue Jun 28, 2011 6:15 am
by MtnViewJohn
I will check the color target bug.

There is a bug in the command line version, cfdg, that breaks tiled mode. To fix it, edit the file main.cpp and move the lines

Code: Select all

  agg::trans_affine tileTransform;
  bool isTiled = myDesign->isTiled(&tileTransform);
to just before

Code: Select all

  if (isTiled) {
      tile = new tiledCanvas(myCanvas, tileTransform);
      myCanvas = tile;
      tile->scale(scale);
  }

Re: Version 3 alpha is available

Posted: Tue Jun 28, 2011 7:05 am
by imposeren
Thanks! This works just great

Context free numeric but content avare natural

Posted: Wed Jun 29, 2011 3:52 am
by imposeren
" Numeric parameters must not depend on any incoming numeric or natural parameters unless the incoming parameter is used unchanged"

Why are you restricting this? For example: we can already increment some natural parameter and send it as shape parameter. So this will make shapes context aware.

I understand that you wan't to make grammar realy context-free but it's NOT ALREADY. I Like in in some ways because I can make complex conditions. You can take it in different way: this context aware syntax can be expanded to non context aware (with loops, etc.)

So you are just impleing artificial restrictions to some context-aware functionality, which can be hacked by other means. Please allow changing of numeric parameters.

This context awareness does not break code that must be realy context-free. It's also just a mean to shorten the code which must be enormous when totaly context-free.

Sorry for my bad English

Re: Version 3 alpha is available

Posted: Wed Jun 29, 2011 8:16 am
by MtnViewJohn
The goal is to make version 3 as context free as version 2. With these restrictions on numeric and natural parameters it is possible to take any parameterized rule and translate it to a finite set of unparameterized rules. So version 3 should not have any theoretical capability beyond what is possible with version 2. But as a practical matter, you can do things with a parameterized rule that are extremely tedious when attempted with a huge family of unparameterized rules.

You can disable the parameter checks by setting the impure configuration parameter:

Code: Select all

CF::Impure = 1

Re: Version 3 alpha is available

Posted: Wed Jun 29, 2011 10:46 am
by imposeren
I was just confused with this:
it's imposible to change "number" parametres but possible to change "natural" parametres from call to call wich can be used to "generate" "number" paramertres.

So this restriction is applied just because translation of nonlinear operations (exponent, etc.) and float numbers to context free code is ambiguous?

I'm curious if conditional code with changing natural parametres realy can be translated to context free code. I'm experimenting with some code that looks like context NON-free.

I was just curious and confused when wrote previous post. Thanks for explanations.

Does "CF::Impure = 1" cause any problems?

Re: Version 3 alpha is available

Posted: Wed Jun 29, 2011 10:29 pm
by MtnViewJohn
I tracked down this bug. It had nothing to do with the recent changes that I made to color targets. The bug was that the loop modification was not computed correctly, but only color targets were broken.

Re: Version 3 alpha is available

Posted: Wed Jun 29, 2011 10:55 pm
by MtnViewJohn
imposeren wrote:I was just confused with this:
it's imposible to change "number" parametres but possible to change "natural" parametres from call to call wich can be used to "generate" "number" paramertres.
A natural parameter can only "generate" a number parameter if you don't change it.
imposeren wrote:So this restriction is applied just because translation of nonlinear operations (exponent, etc.) and float numbers to context free code is ambiguous?

I'm curious if conditional code with changing natural parametres realy can be translated to context free code. I'm experimenting with some code that looks like context NON-free.
I would like to see if context-sensitive grammars can be generated even with the current restrictions on parameters. I am not a mathematician so I am only guessing that using primitive recursive function theory will allow me to add the parameter feature without compromising the spirit of Context Free.
imposeren wrote:I was just curious and confused when wrote previous post. Thanks for explanations.

Does "CF::Impure = 1" cause any problems?
All it does is turn off the compliance check for number and natural parameters.

Re: Version 3 alpha is available

Posted: Mon Dec 19, 2011 9:15 pm
by MtnViewJohn
I have finished the online documentation for Version 3: http://www.contextfreeart.org/mediawiki ... troduction. I will write some reference cards soon and rewrite the embedded examples. Version 3 beta will be coming soon.