Comments (3)
The single letter abbreviations already have long variants, except for x, y, and z. r and rotate are interchangeable, same for s and size, f and flip, trans and transform, h and hue, sat and saturation, b and brightness, a and alpha. skew has always just been skew, same with time and timescale.
We have already done a compatibility-breaking syntax change going from cfdg 2.x to cfdg 3.x. The code you are working with is in the old syntax, you can translate it here. I don't want to do another major syntax change unless it brings compelling new features.
On a side note, your code does randomness in the cfdg 2 manner, where random rule selection is the only way to make a shape do different things. With cfdg 3 you can have random actions inside a rule. Your grass code can be reduced to 5 rules:
startshape field
tile {s 150 }
background { hue 83.1 sat 0.4664 b -0.1255}
rule field
{
grass{hue 97.6 sat 0.7282 b 0.7647}
}
# Add a chance to add a seedling.
rule grass 5
{
seedling{}
grass{b -0.1…0.2 hue -0.1…0.1 sat -0.01…0.01
r -5…5 x -10…10 y -10…10}
}
rule grass 0.1
{
grass{r 0…360}
}
rule grass 0.01
{
// end
}
rule seedling
{
SQUARE{}
seedling{y 1 r -2…2 s 0.991}
}
from context-free.
It is undesirable to elliminate startshape keyword, because it's a good way to switch between different branches during debugging. In the node based systems like Fusion, Nuke or Touchdesigner you can change the current node you want to output to the screen, just think of it in similar way.
from context-free.
I would never get rid of startshape. But I should make it optional. If there is no startshape then the first shape in the file is the startshape. I would rather do this than pick a default startshape name like main or scene because many non-english speakers use Context Free.
I think that adding a Pythonic syntax is a non-starter. But I would be interested in a ContextFree module for Python. I only know a little about Python. But it seems to me that function decorators could be used to allow shape rules to be expressed as Python code. The AGG rendering engine could be bound to Python as a C++ library. It would be a fun project for someone who knows a lot of Python. I would be glad to help if someone wanted to do this.
from context-free.
Related Issues (20)
- Null pointer dereference while printing syntax error HOT 1
- Bad syntax for functions causes windows client crash HOT 2
- Dead Link HOT 3
- Question about 16 bit rendering HOT 13
- Release dates at https://www.contextfreeart.org/downloads.html HOT 2
- Unhandled Exception when submitting to gallery HOT 3
- What are rule weights? HOT 4
- Dead link https://github.com/MtnViewJohn/context-free/wiki/Targeting-a-Color HOT 1
- add gh topics HOT 1
- how could I count iterations? HOT 1
- Compiling to WASM? HOT 11
- The download link for Mac on the website requires you to right click and select "save link as" HOT 1
- Issue installing on Ubuntu HOT 2
- missing necessary library in readme to compile HOT 1
- how to I export all frames to jpg at 6000x6000 resolutions HOT 2
- [Documentation] Specific examples explained on the wiki HOT 1
- Requesting docker development hub for contextfree development HOT 1
- [Doc] Clarifications on the TRSSF canonical order
- Compile problem with src-common/cfdg.l
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from context-free.