home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 5
/
DATAFILE_PDCD5.iso
/
utilities
/
f
/
fractal112
/
!Fractal
/
Help
/
Scripts
< prev
next >
Wrap
Text File
|
1995-09-05
|
13KB
|
300 lines
Fractal Scripts
===============
The script facility allows !Fractal to be driven by command scripts rather
than from the screen. This facility is provided to allow:
a) Batch running, useful for functions that take a long time to plot.
Multiple plots are allowed and the images can be saved.
b) Creating composite fractals, such as Fault shapes or multiple L-systems.
c) Creating a fractal followed by 1 or more 3d transforms.
Essentially the script language simulates accessing !Fractal from its menus
and panels, so you get full access to its functionality. Scripts are text
files created in !Edit or any other editor. They feature simple expression
evaluation, variables and screen plotting. They provide a means for creating
complex images from multiple fractals.
Several scripts are provided in the Resources directory (use Misc->Resources
from the menu to open), and should help to illustrate the syntax and
capabilities.
Running Scripts
===============
Scripts are run by dragging the file onto a !Fractal window or its iconbar
icon. Scripts will normally specify the fractal function they require. A
script may be terminated by clicking Adjust. Any error messages (syntax or
otherwise) are written to the file ScriptLog in the Resources directory. To
syntax check a long script just comment out all the Draw commands and run
it.
Sprite images are very large, so to perform a long run saving the images as
you go, save the images in GIF format or use an ArcFS or Compression
pathname, since sprites compress very well. This should allow 20+ Mode 15
images per 800k floppy.
To superimpose fractal images use the command:-
Off Image,Redraw,Clear
For images plotted using the x/y pixel mapping, X/Y Guessing must also be
turned off unless the x/y image is plotted first. This is because the
guessing algorithm looks at the colours already plotted to see if subsequent
pixels need plotting.
Script Syntax
=============
Essentially the syntax is free format with punctuation necessary only to
avoid ambiguity. The first line of the text must be the characters "Script".
Follow these syntax guidelines:
a) Multiple commands are allowed on the same line, except for comments where
the rest of the line is ignored. Use a semi-colon (;) to separate each
command.
b) Case of commands and variables is not significant.
c) Commands and keywords may be truncated to the most significant
characters. Variable names must be given in full.
d) Spaces are ignored except where significant, as in menu item names and
data names.
e) Equals (=) may be used to seperate keywords and data values.
f) Use commas (,) to seperate multiple items for a command (eg. Data or Select).
Command Summary
===============
Note: Refer to the main help files for permissable values for data items.
Square breakets [] indicate optional items, a vertical bar | is a choice
between values, exp an expression (explained later) and str_exp a string
expression.
\ Comment All text until end of line is ignored.
3d_Elevation exp Sets the 3d elevation to angle in degrees.
3d_InvLog Sets the 3d Inverse Log mapping.
3d_Log Sets the 3d Log mapping.
3d_Linear Sets the 3d Linear mapping.
3d_Max exp Sets the 3d maximum height value.
3d_Min exp Sets the 3d minimum height value.
3d_Riemann On | Off Sets the 3d Riemann Plot on or off.
3d_Rotation exp Sets the 3d rotation to angle in degrees.
3d_Scalar exp Sets the 3d height mapping scalar.
3d_XY_Plot On | Off Sets the 3d X/Y Plot on or off.
CellFill exp,exp Invokes the CellFill function starting at x/y.
Clear Clears the image.
Colour exp1 [,exp2] Like GCOL except sets the physical colour.
Draw Plot the current function.
Data item=exp [,...] Set one or more data items, name as in data panel.
Fractal=function name Set fractal function.
Gcol exp1 [,exp2] Similar to the BASIC GCOL statement.
If / Else / Endif Script control - see later.
Load str_exp Load a sprite or resource file, but not a script.
Off item1,item2,... As Select, but sets menu item off if on.
On item1,item2,... As Select, but sets menu item on if off.
Pal_Blue exp1,exp2 Sets the level of the blue component for a colour
number.
Pal_Green exp1,exp2 Sets the level of the green component for a colour
number.
Pal_Red exp1,exp2 Sets the level of the red component for a colour
number.
Plot exp,exp,exp Similar to the BASIC PLOT statement.
Plot_Change exp Sets the colour change interval for point plots.
Plot_Colour exp Sets the physical colour for point plots.
Plot_Random On | Off Random colouring on/off for point plots.
Plot_Step On | Off Step colouring on/off for point plots.
Plot_Stepby exp Sets the step colour increment.
Plot_Type exp Sets the point plot style.
Select item1,item2,.. Select menu item where item is name as in menu.
Save_AFG=str_exp Save image in AFG format. str_exp is filename.
Save_Image=str_exp Save image. The full pathname should be given,
unless you set the current directory beforehand.
var = exp Set a variable to the value of exp.
While / Endwhile Script control - see later.
XY_Guessing On | Off Sets the X/Y Guessing on or off. Turn off to allow
x/y plot images to be superimposed.
Command Details
===============
CELLFILL exp1, exp2 exp1=x coord, exp2=y coord (in os units)
--------
This invokes the CellFill function starting at the given coordinates. All
adjacent pixels of the same colour as the start point will be set to the
CellFill colours. This allows you to flood-fill areas previously plotted. To
set the fill colours switch to the CellFill function, ie.
Fractal=CellFill \ Selects CellFill
Data Up=45,Down=56 \ Set the colours
Fill x,y \ Start filling at x/y
The standard cellfill function can be invoked via DRAW. See MandyGold2 and
MandyGold1 scripts for the different effects between the two styles of
filling.
COLOUR exp1 [,exp2]
------
Sets the graphics colour in a similar way to the BASIC GCOL statement. If
just exp1 is given exp1 is the colour, otherwise exp1 is the GCOL mode (see
the BASIC manual), and exp2 the colour. Colour numbers are 0-255 and are the
physical colour numbers, and thus map directly onto the current palette.
This statement is for use with non-default palettes.
DATA item=exp [,....]
----
Sets the data parameters for the current function, where item is the data
name as shown in the Data display panel, including internal spaces. Multiple
data names can be specified on the same line, separated by commas. Use
Initial or InitZoom as item names to simulate these buttons on the data
panel. For L-Systems the following extra keywords are available (they relate
to the data panel) :
Angles = exp number of angles
Axiom = string expression eg. Axiom='F-F'
Clear_rules clears all rules for this L-system
Iterations = exp number of iterations
Name = string_expression Sets name of L-system
Rule = string expression eg. Rule='F=XFX'
1st letter must be the rule-id, the rule string must start in col.3
Updates (if ruleid exists) or adds a new rule.
eg Data x0=34,width=n+34;
GCOL exp1 [,exp2]
----
Sets the graphics colour in a similar way to the BASIC GCOL statement. If
just exp1 is given exp1 is the colour, otherwise exp1 is the GCOL mode (see
the BASIC manual), and exp2 the colour. Colour numbers are 0-255 and are
made up of the bits BBGGRRTT where B=Blue (*64), G=Green (*16), R=Red (*4) &
T=Tint bits. This format is used since it makes it easier to step through
brightness levels (the BASIC format is TTBBGGRR). This mapping only works
with the default palette. For other palettes use the COLOUR statement.
LOAD str_exp