[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
8.26 Utilities for parsing MGL
MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap (mgl2png
, mgl2gif
) or vectorial (mgl2eps
, mgl2svg
) images. Tool mglview
show MGL script and allow to rotate and setup the image. Also you can translate MGL script to C++ file by help of mgl2cpp
tool.
All of this tools have similar set of arguments. First argument is name of script file, next argument is optional output file name, last arguments are options. There are options for setting script parameters (it is $0, $1, ... $9
) and locale settings. The script parameters have format ‘-Nval’. Here N=0,1...9 is parameter ID and val is its value. For example, option ‘-1test’ set to substitute ‘test’ instead of $1
in the script. Option -Lval set locale to val. For example, ‘-Lutf8’ will set UTF-8 locale for script.
Additionally you can create animated GIF file or a set of JPEG files with names ‘frameNNNN.jpg’ (here ‘NNNN’ is frame index). You should use mgl2gif
tool and specify the values of $0
parameter for making animation. Values of the parameter $0
can be specified inside the script by comment ##a val
for each value val
(one comment for one value) or by option(s) ‘-Aval’. Also you can specify a cycle for animation by comment ##c v1 v2 dv
or by option -Cn1:n2
. Tool mgl2gif
will execute script several times (once for each specified value of $0
) and save result in animated GIF file. For saving each frame in JPEG just add command write ''
at the end of the script.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |