Version 3 alpha is available
Moderators: MtnViewJohn, chris, mtnviewmark
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Version 3 alpha is available
The long overdue version 3 of Context Free is now available in an alpha release.
Get it at the CF3alpha download page.
All of the significant features are there, but a few remain to be implemented. Please give it a try and help find bugs.
Get it at the CF3alpha download page.
All of the significant features are there, but a few remain to be implemented. Please give it a try and help find bugs.
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
The version 3.0alpha has been updated to a new build. The new build fixes the issue with some loops in paths displaying incorrectly. Also, Animations in the Windows build save to Quicktime movies again.
Re: Version 3 alpha is available
Yay :)
Last night I was trying to build on Ubuntu 11.04 and had some issues, I could get the original files and compile and put exact errors up, but here's what I've done:
added this to stacktype.h:
#ifndef UNINT32_MAX
#define UINT32_MAX 4294967295U
#endif
and in builder.cpp, scanner.h is upper case ("Scanner.h")
And now I'm getting compile errors that look like:
astreplacement.cpp:(.text+0x6f34): undefined reference to AST::CommandInfo::CommandInfo(unsigned int, AST::ASTcompiledPath*, double, AST::ASTpathCommand const*)'
objs/astreplacement.o: In function `AST::ASTrule::traversePath(Shape const&, Renderer*) const':
astreplacement.cpp:(.text+0x7396): undefined reference to `StackRule::Equal(StackRule const*, StackType const*)
Last night I was trying to build on Ubuntu 11.04 and had some issues, I could get the original files and compile and put exact errors up, but here's what I've done:
added this to stacktype.h:
#ifndef UNINT32_MAX
#define UINT32_MAX 4294967295U
#endif
and in builder.cpp, scanner.h is upper case ("Scanner.h")
And now I'm getting compile errors that look like:
astreplacement.cpp:(.text+0x6f34): undefined reference to AST::CommandInfo::CommandInfo(unsigned int, AST::ASTcompiledPath*, double, AST::ASTpathCommand const*)'
objs/astreplacement.o: In function `AST::ASTrule::traversePath(Shape const&, Renderer*) const':
astreplacement.cpp:(.text+0x7396): undefined reference to `StackRule::Equal(StackRule const*, StackType const*)
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
I forgot to add stacktype.cpp and CmdInfo.cpp to the Makefile. Just add them to the COMMON_SRCS variable. I will upload a fixed version tonight.
Re: Version 3 alpha is available
Hmm ok, I thought I tried that last night too (the stacktype.cpp not the CmdInfo.cpp)... maybe I was too tired. I'll give it a shot now, cheers!
Re: Version 3 alpha is available
g++ -Isrc-common -Isrc-unix -Iobjs -Isrc-agg/include -Isrc-common/agg-extras -O3 -Wall -c -o objs/stacktype.o src-common/stacktype.cpp
In file included from src-common/stacktype.cpp:57:0:
src-common/stacktype.h:60:27: error: ‘std::istream’ has not been declared
src-common/stacktype.h:61:28: error: ‘std::ostream’ has not been declared
src-common/stacktype.h:62:34: error: expected ‘;’ before ‘(’ token
src-common/stacktype.h:63:41: error: ‘std::ostream’ has not been declared
fix'd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then:
src-common/stacktype.cpp:221:12: error: ‘memcmp’ is not a member of ‘std’
So just needed to include the std libraries to stacktype.h:
#include <iostream>
#include <cstring>
no need for the:
#ifndef UNINT32_MAX
#define UINT32_MAX 4294967295U
#endif
that I put in the last post. It compiled!
:~/Desktop/CF3$ ./cfdg
Missing input file
cfdg - 3.0beta(v11)
Usage:
cfdg [options] input.cfdg [output.png/svg]
or to pipe a cfdg file on standard input:
cfdg [options] - [output.png/svg]
If the output file name is omitted and the -o option and the -C option are not used
then the output will be sent to stdout.
In file included from src-common/stacktype.cpp:57:0:
src-common/stacktype.h:60:27: error: ‘std::istream’ has not been declared
src-common/stacktype.h:61:28: error: ‘std::ostream’ has not been declared
src-common/stacktype.h:62:34: error: expected ‘;’ before ‘(’ token
src-common/stacktype.h:63:41: error: ‘std::ostream’ has not been declared
fix'd
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Then:
src-common/stacktype.cpp:221:12: error: ‘memcmp’ is not a member of ‘std’
So just needed to include the std libraries to stacktype.h:
#include <iostream>
#include <cstring>
no need for the:
#ifndef UNINT32_MAX
#define UINT32_MAX 4294967295U
#endif
that I put in the last post. It compiled!
:~/Desktop/CF3$ ./cfdg
Missing input file
cfdg - 3.0beta(v11)
Usage:
cfdg [options] input.cfdg [output.png/svg]
or to pipe a cfdg file on standard input:
cfdg [options] - [output.png/svg]
If the output file name is omitted and the -o option and the -C option are not used
then the output will be sent to stdout.
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
I'm going to put
in stacktype.cpp and
in stacktype.h. Also in stacktype.h there needs to be
before
The C99 standard requires this but the Windows and Mac development environments do not seem to implement the C99 spec fully. It looks like the Ubuntu gcc toolchain implements this part of C99.
When my Ubuntu VM finishes updating I will try it.
Code: Select all
#include <iostream>
#include <cstring>
Code: Select all
#include <iosfwd>
Code: Select all
#define __STDC_LIMIT_MACROS
Code: Select all
#include <stdint.h>
When my Ubuntu VM finishes updating I will try it.
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
OK, I got it to compile and run on Ubuntu. I had to add
to CmdInfo.h too and add -march=i686 to the Makefile.
I have uploaded all these changes to the tarball at http://www.contextfreeart.org/download/ ... 0alpha.tgz
Code: Select all
#define __STDC_LIMIT_MACROS
I have uploaded all these changes to the tarball at http://www.contextfreeart.org/download/ ... 0alpha.tgz
Re: Version 3 alpha is available
Awesome! Makes fine now, and generates beautiful SVG :) Thank you.
Re: Version 3 alpha is available
[quote="MtnViewJohn"]OK, I got it to compile and run on Ubuntu. I had to add
[code]#define __STDC_LIMIT_MACROS
[/code]to CmdInfo.h too and add [b]-march=i686[/b] to the Makefile.
I used [b]-march=native[/b] and compiled latest version successfully on my 64 bit linux box (but -march=native should also work on i686) only pretty weird architectures don't get recognised by the compiler.
[code]#define __STDC_LIMIT_MACROS
[/code]to CmdInfo.h too and add [b]-march=i686[/b] to the Makefile.
I used [b]-march=native[/b] and compiled latest version successfully on my 64 bit linux box (but -march=native should also work on i686) only pretty weird architectures don't get recognised by the compiler.
Re: Version 3 alpha is available
Yes, with "-march=i686" sources does not build on x86_64.
I also have some questions. Where Can I get working examples of rules with parametres? I tried to write simple tests myself, but it does not work. )=
Maybe this is caused of source version (v11). Can you update sources tarball or suggest examples?
I tried this code:
echo "
startshape FOOZ
shape FOO(number someNumber, adjustment someAdjustment, shape someShape) {
loop i = 0, someNumber [ someAdjustment ] {
someShape[a -0.5]
} finally {
someShape[]
}
}
rule FOOZ {
FOO(3, [s 0.5], CIRCLE)[]
}
" cfdg -C -
And I got "Error in - - syntax error". Why doesn't it say what line containts error? I tried both file input and stdin input
I also have some questions. Where Can I get working examples of rules with parametres? I tried to write simple tests myself, but it does not work. )=
Maybe this is caused of source version (v11). Can you update sources tarball or suggest examples?
I tried this code:
echo "
startshape FOOZ
shape FOO(number someNumber, adjustment someAdjustment, shape someShape) {
loop i = 0, someNumber [ someAdjustment ] {
someShape[a -0.5]
} finally {
someShape[]
}
}
rule FOOZ {
FOO(3, [s 0.5], CIRCLE)[]
}
" cfdg -C -
And I got "Error in - - syntax error". Why doesn't it say what line containts error? I tried both file input and stdin input
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
Sorry. There were some changes to the syntax and I haven't uploaded a new alpha version that supports the syntax described in the documentation. Change all of the '[' to '{' and ']' to '}' and try again. I will try to get a new alpha uploaded this weekend. You can also do
But you have to say this after you declare shape FOO.
Not specifying the line number of the error is a bug in the command line version. In the gui version you get a clickable link to the error.
If you are using OS X then specify "-march=nocona" for x86_64. Everyone else can use "-march=native".
Code: Select all
startshape FOO(3, {s 0.5}, CIRCLE)
Not specifying the line number of the error is a bug in the command line version. In the gui version you get a clickable link to the error.
If you are using OS X then specify "-march=nocona" for x86_64. Everyone else can use "-march=native".
Re: Version 3 alpha is available
I'm using linux, so there are no GUID for me. Old code works just fine. But I still can't get anything working with new one.
$ cfdg
cfdg - 3.0beta(v11)
$ cfdg
cfdg - 3.0beta(v11)
- MtnViewJohn
- Site Admin
- Posts: 883
- Joined: Fri May 06, 2005 2:26 pm
- Location: Mountain View, California
- Contact:
Re: Version 3 alpha is available
New builds of version 3 alpha have been uploaded. This build introduces some syntax changes that will break previous designs. I request the people who have uploaded v3 designs to the gallery edit their designs. The syntax changes are:
- Version 3 and version 2 syntax cannot coexist in one file (or in included files). Only use one or the other.
- The shape token is only used for rules. Paths use the path token.
- Adjustments are grouped using square brackets, not curly brackets. Use single pairs of brackets for basic adjustments, [hue 50 x 1.5] , and double pairs of brackets for ordered adjustments, [[x 0.5 s 0.95 x 0.5]]
- background {whatever} is now CF::Background = [whatever]
- Same goes for size and tile.
- All of the CF_WHATEVER variables have been renamed to CF::WhatEver.
- If you don't specify a loop step then it will be 1, not 1 or -1.
- The (=) syntax indicates that a shape's (or path's) are to be reused
- Version 3 files use import file.cfdg to include a file, instead of include file.cfdg
- Multiple pass parsing. You still need to declare a shape's parameters before you can use a shape.
- Frame time function or variable
- User-defined functions
- More symmetry options beyond tiling (other planar groups and frieze groups)
Re: Version 3 alpha is available
I've started working through the CF3.0 examples I've already posted including this [link design:2668]one[/link] CF::Size doesn't seem to work for me, have I got the syntax wrong? Also crop on the command line doesn't seem do too much for me (small point version number of linux beta seems to be unchanged).