TODO list and scratch pad for Structure Synth. /Mikael

Structure Synth 1.0.0 ("Potemkin") Released
------------------------------------------
Structure Synth is a tool for generating 3D structures from recursive rules. The structures are often complex and surprising.
Structure Synth integrates with third-party renderers (such as Sunflow and POV-Ray) using a flexible template based export system.

Binaries for Windows (XP and Vista).
Mac binaries available soon.
Linux is still source only.

Download instructions at:
http://structuresynth.sourceforge.net/download.php

New features since (0.9.5):
- Added a 'Recent files' menu entry.
- Optional depth-first recursion (using 'set recursion depth')
- Added application icon.
- Support for a new generic 'template' primitive 

A new Template Export Browser:
- Shows the defined primitives in the template (highlighting used and missing).
- Integrated XML editor with syntax highlighting for quickly modifying the template.
- Automatic unique filename generation.
- Define output width and height.
- A post modification window allows you to modify the output before saving.

The template XML syntax has been updated:
- A new <description> element. 
- The 'substitution' element is now called 'primitive'
- Added 'defaultExtension' tag.
- Added 'runAfter' tag.

For more information see:


04 May 09 [MHC] 
[4h]


Structure Synth 0.9.5 ("Haiku") Released
-------------------------------------------
Binaries for XP and Vista. 
Mac binaries will hopefully be available soon.
Linux is still source only.
 
New features: 
- New color features: a 'random color' operator with different palettes (random hue, random rgb, greyscale, sampling from image, or from user-defined list). 
- Now uses two independent (Mersenne Twisters) random number generators: one for geometry and one for colors.
- Upgraded to Qt 4.5.0. Now Structure Synth is dual licensed under GPL and LGPL.
- Added 'blend {color} {strength}' operator.
- Added 'set seed initial' for syncing random seed. 
- Added 'set maxsize ...' and 'set minsize ...'.
- Added support for specifying a startup .es file on the Commandline (this makes file associations possible). 
- Added support for drag'and'drop (drop a .es file onto the clipboard).
- Added simple GUI for manipulating preprocessor defines.
- Added templates by Neon22 and Groovelock to SVN.

Minor changes and bug fixes:
- Added close icon to tabs.
- Applied more agressive optimization on Windows build (SSE2/fast fp-math). SSE2 is now required! 
- Fixed a bug where a recursive rule (not producing objects) could fill memory.
- Added export of background color to templates.
- BugFix: The scrollwheel can now be used to zoom again.


Next version:
- Show hour-glass when making long operations (before progress when rendering...)    
- Better sphere implementation (remember transformation thing...)
- 

Request:
- Remember file extension.

Filename (and 'run the following') should be possible to set in template.
If changed in dialog it should be persistent.

Template Rendering Dialog:

Setup Tab:

Choose Template:
[Sunflow.template] [<]

Notes:
(This template was created by MHC....)

Primitives in template:
Box::spheres   comment
Box::float     comment
Grid           Warning: not found in template. (shown in red)

(o) Render to file: [c:\testmig.es] [File...]
	[x] add unique ID to filename (testmig-1.es) <- autoreview
( ) Render to clipboard.

[x] Run the following commands after export:
    C:\sunflow\sunflow.bat {File}

Template details tab:

Output Size:
X: 640 Y: 400. [x] Lock Aspect

[x] Modify Template before applying:

[                 ]
[                 ]
[				  ]
[                 ]
		[Save modifications] [Undo]

[x] Modify Template output before saving
    (Spawns an edit window)





Make Debug moc'ing on release...

Debug.Info(...);
Debug.ShowProgress(...);
Debug.SetProgress(...);   // TODO: Should throw exception if cancelled...
Debug.HideProgress();
Debug.Message(...);

Builder.load(filename);
Builder.replace(before, after);
QString text = Builder.applyTemplate(...);
Builder.run();

IO.save(text, filename);
IO.spawnProcess(...);
IO.saveImage(filename); // For OpenGL output...

About box sizing on Mac.
Change 'mac.pro' -> 'StructureSynth.pro'
Check copy paste menu

Template Render Dialog
----------------------
Save file as:
Default file path: [...............] [Dir...]
File name: [Output0001.es] [File...]

Post processing:
[ ] Run the following command after saving picture.
    [C:\program files\Sunflow\Sunflow.bat {FILENAME}]
   
 Edit script before saving:
[                  ]
[                  ]
[                  ]
[                  ]




On startup -> show 3D view nav info...
Help -> add weblinks...

- Restructure: 
	-Check directory structure.
	-Comments
				
- Website: 
    - add section links.
    - tutorials: 'EisenScript Kata'

- JanJacobSV has some interesting 3D experiments with CFDG and Virtools. http://www.youtube.com/watch?v=KWgQ8XIPAio
	
- [Collada] Support? (http://www.khronos.org/collada/)

- VRML example (could be fun)







EisenScript
-----------

Structures are specified in EisenScript (named after the russian film director Sergei Eisenstein). 

EisenScript is processed by the Eisenstein Engine by the following steps:
1) Preprocessor (strips comments imports '#include' statements).
2) Tokenizer (divides string input into symbols. The string input is split at any white space (except if it occurs inside quotes).)  
3) Parser (standard recursive descent parser). The parser creates a 'ruleset' from the text input. 
4) Name resolving. Rules contain symbolic references to other rules. These symbols must be resolved.

The EBNF notation for EisenScript looks like this:

program = { set | rule } ;
rule = 'RULE' ,  rule_name , [ weight ] , '{' , { set | action } , '}' ;
action = { transformationloop } [transformationlist] rule_ref ;
transformationloop = number , '*' , transformationlist ;
transformationlist = '{' , { transformation } , '}';
transformation = 'X' , number |                      // translations
                 'Y' , number |
                 'Z' , number |
                 'RX', number |						 // rotation about axis
                 'RY', number |
                 'RZ', number |
                 'S', number |						 // resizing (all axis equal)
                 'S', number number number, 		 // resizing for x,y,z individually
                 
set = 'SET' , var_name , string ;

'rule_ref', 'var_name', and 'string' are text strings with a reasonable set of allowed characters.
Though not strictly a part of the syntax, a few rules are provided as predefined primitives in Structure Synth:

Primitives: 
-----------
box      - solid box
grid	 - wireframe box
sphere   - 
line     - along x axis, centered in y,z plane.
point    - centered in coordinate system.
cylinder - the symmetry axis will be the current x axis.
pbox     - continues box (will be drawn smoothly as the coordinate system transforms).
pcylinder- polygonal cylinder (will be drawn smoothly as the coordinate system transforms).
tube     - (With number of division)

