Incendia Script

From IncendiaWiki
Jump to: navigation, search

Incendia Script consists in a series of fractal transformations on where every transformation is a set of predefined commands with given parameters.
The scripts are defined in a text format and are saved with a ".prg" file extension. You can edit them in any text editor such as notepad.exe
Many of the fractals defined on Incendia can be exported as scripts, so they can provide an starting point for making modifications.
The general method for defining scripts consists in starting with transformation command "tform", with marks the start of a transformation set. Next to this definition is the "probability" command, that is used to defining a probability for the current transformation.
After defining these two main commands, the transformation commands are used, commands such as "scale", "translate" and "rotate", for example. The command definitions for the current transformation continues until another "tform" command is found, that defines the start of a new transformation. Heres an example of a simple script:

;This script defines a simple sierpinski tetrahedron, composed of four transformations.
probability 0.5
scale 0.5 0.5 0.5

probability 0.5
scale 0.5 0.5 0.5
translate 1 0 0

probability 0.5
scale 0.5 0.5 0.5
translate 0 1 0

probability 0.5
scale 0.5 0.5 0.5
translate 0 0 1

1. All commands must be in lowercase, uppercase or incomplete commands are ignored.
2. Every command has a finite number of parameters, if theres a missing commands or an erroneous parameter, the command is ignored.
3. If the ";" character is found on a line, the entire line will be ignored. This is for inserting comments on the scripts.

General Commands

Affine Transformations Commands

Transformation Commands

Fractal Commands

Flame Commands
These are some of the standard flame variations, most of them consist in simple functions with a weight factor that are added to the current iteration value.
In the case of the flame2 commands, they are a variation on the flame algorithm :
The Flame commands are:

Conditional Commands
These commands acts as filters for the transformation elements, allowing the execution of the rest of the commands if their conditional is true, or else, bailing out.
In the case of the baseshape command, if the selected baseshape is equal to the one defined by the command, the nexts commands on the transformation are executed. The index of the baseshapes are visible on the Baseshape editor.
The Boolean commands are:

Baseshape Commands
These commands are for adding the baseshapes to the actual script.
Heres an example of a simple script:

;Simple Incendia Orrery

base_type 1
base_depth 10
base_position 1 0 0
base_radius 0.0625

base_type 2
base_depth 10
base_radius 1
base_parameters 0.005

base_type 42
base_depth 0
base_radius 0.1
base_parameters 1

rotate_xyz 0 0 137.51
scale 0.85 0.85 0.85

The baseshape commands are: