Version 3 alpha is available

New releases, news, and anything else important.

Moderators: MtnViewJohn, chris, mtnviewmark

User avatar
Monkstone
Posts: 13
Joined: Fri Jul 03, 2009 10:40 pm
Location: Pembrokeshire, UK
Contact:

Re: Version 3 alpha is available

Post 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.

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

Re: Version 3 alpha is available

Post by MtnViewJohn »

It works on my system. What happens when you render it?

User avatar
Monkstone
Posts: 13
Joined: Fri Jul 03, 2009 10:40 pm
Location: Pembrokeshire, UK
Contact:

Re: Version 3 alpha is available

Post 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).

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

Re: Version 3 alpha is available

Post 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.

imposeren
Posts: 0
Joined: Thu Jun 23, 2011 7:58 am
Location: Ukraine, Kiev

Re: Version 3 alpha is available

Post by imposeren »


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

Re: Version 3 alpha is available

Post 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);
  }

imposeren
Posts: 0
Joined: Thu Jun 23, 2011 7:58 am
Location: Ukraine, Kiev

Re: Version 3 alpha is available

Post by imposeren »

Thanks! This works just great

imposeren
Posts: 0
Joined: Thu Jun 23, 2011 7:58 am
Location: Ukraine, Kiev

Context free numeric but content avare natural

Post 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

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

Re: Version 3 alpha is available

Post 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

imposeren
Posts: 0
Joined: Thu Jun 23, 2011 7:58 am
Location: Ukraine, Kiev

Re: Version 3 alpha is available

Post 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?

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

Re: Version 3 alpha is available

Post 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.

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

Re: Version 3 alpha is available

Post 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.

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

Re: Version 3 alpha is available

Post 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.

Locked