MathGL library provides several tools for parsing MGL scripts. There is tools saving it to bitmap or vectorial images (
mglview show MGL script and allow to rotate and setup the image. Another feature of
mglview is loading *.mgld files (see
ExportMGLD()) for quick viewing 3d pictures.
Both tools have similar set of arguments. They can be name of script file or options. You can use ‘-’ as script name for using standard input (i.e. pipes). Options are:
mglconv have following options:
Also you can create animated GIF file or a set of JPEG files with names ‘frameNNNN.jpg’ (here ‘NNNN’ is frame index). Values of the parameter
$0 for making animation can be specified inside the script by comment
##a val for each value
val (one comment for one value) or by option(s) ‘-A val’. Also you can specify a cycle for animation by comment
##c v1 v2 dv or by option
-C v1:v2:dv. In the case of found/specified animation parameters, tool will execute script several times – once for each value of
MathGL also provide another simple tool
mgl.cgi which parse MGL script from CGI request and send back produced PNG file. Usually this program should be placed in
/usr/lib/cgi-bin/. But you need to put this program by yourself due to possible security issues and difference of Apache server settings.