After starting the program the screen will show a drawing canvas and a textual input window which allows you to enter various commands.
[11:06 AM] MIchael@askar> ./run.sh ocamlbuild -build-dir ../build -clean main.byte Finished, 0 targets (0 cached) in 00:00:00.←[K 00:00:00 1 (0 ) ...chael\Documents\Sources\spiro\src\../build ..... Finished, 1 target (0 cached) in 00:00:00. [ 0/0 ] ?
This output indicates that the cursor is currently set to 0/0 and the spiro program is ready for input. The input has the following format:
[ <repeat value> ] <command> [ <arguments> ]
The repeat value specifies the number of time the following commands is to be exected.
A point on the canvas is described by pt ::= <num> '/' <num>, e.g. 100/200 denotes the absolute point X=100 and Y=200. IN contrast 100 200 moves simply a movement relative to the cursor. Drawing commands are executed relative to the cursor.
Possible commands are:
|move <pt>||move the the cursor to the given value|
|set <pt>||set the cursor to the given x/y values|
|circle <radius>||Draws a circle with the given radius around the current cursor position.|
|rect <pt>||Draw a rectable from the current cursor and the X/Y size|
|line <pt>||Draw a line from the current cursor and the X/Y size|
|scale <value>||Apply the scale to the figure|
|turn <deg>||Rotate the figure by the given turn value|
||store all folowing operations in the named metafile|
|screen <num> <num>||Changes the canvas size|
|dir||Display the list of macros|
|list||Display the disoplay commands of the current macro|
|!||Execute a shell command|
|save <metafile> <file>||Save the metafile <metafile> in an external file <file>.mf|
|load <file>||Load load the external file <file>.mf into the meta file with the same name|
|edit||Edit the cvur *** currently broken ***|
|clear||Clear the canvas and reset the origin|
I am using self containing windows environment which can be found at http://www.typerex.org/ocpwin.html. The installtion of this environment is rather simple because it self containing in a single windows installer.
The development environment comprises of a set of command line tools. I am using these tools together with the sublime text editor.
The release is installed into the source dir src/ where the complete source code is installed.
---------+-- run.sh -- | | +-- src/ --
This directory contains a make file which is beeing used to build the complete environment.
$ make $ ocamlbuild main.byte -lib graphics mkdir 'c:\Users\MIchael\Documents\Sources\spiro\src\_build' Finished, 0 targets (0 cached) in 00:00:00. $
The top level directory contains a file run.sh which can be used to start the spiro application.
The top directory of the release package contains the files cc.mf, ll.mf and rr.mf. They can be used to test the release as shown in the picture below.
Naturally typing the same commands as shown in the screenshot should yield the same results as they are shown on the canvas on the left hand side!
While porting the code from a linux environment to the windows envrionment a few things have been broken. These issue have not been fixed yet.
The source code is avaiable in a repro in https://github.com/merdmann/spiro.