Programmer: Ken Brakke, brakke@susqu.edu.
To run the sample movie: Open the C:\evmovie folder in Windows Explorer. Drag the folder
testmovieand drop it on top of evmovie.
To make the evmovie program available for your movie files, do any of the following:
c:\catenoid\movie> c:\evmovie\evmovie frame*.offb
./evmovie testmovie/*.offbTo make evmovie available in movie file folders: I suggest you copy the evmovie executable file to a directory on your PATH (such as /usr/local/bin). Otherwise you can invoke it from by typing its absolute path, or, as a last resort, copy it into each folder where you have movie files.
Drag-and-drop: You can drag a folder containing movie files and drop it on the evmovie program. You have to drag the folder icon itself, not some file within the folder. Evmovie will look within the folder, and assumes all the *.offb files within the folder constitute the movie. The frames will be run in alphabetical order. A command window will also pop up, used for error messages and such.
Command line: The arguments to evmovie can be either one folder name or a list of individual movie files (wildcards permitted). So if testmovie were a folder with movie files, you could do
evmovie testmovieor you could do
evmovie testmovie\frame*.offbor if you were in the testmovie directory you could
evmovie frame*.offbThe wildcard should be expanded into an alphabetical list of files, not numerical order, so be sure your frame files are appropriately named. A name style like frame-0001.offb, frame-0002.offb, ... will work much better than freme-1.offb, frame-2.offb, ...
After evmovie starts, it reads the first lines of all the frame files, to check if they are all present and readable. With hundreds or thousands of frames possible, this may take a while, so evmovie prints out frame numbers every once in a while as it does this. Then evmovie prints a message about how many frame files it found, and how many it thinks it can fit into memory at once. The first frame file is read in and the display window popped up. Further frame files are read in on demand; if there is not enough room in memory, then the least-recently-used frame is replaced in memory. Therefore the total number of frames is limited by disk space, not RAM.
Frame files record the geometry of the surface only, so the particular view of the surface in Evolver graphics is irrelevant (unlike the Evolver postscript command, which uses the current view).
Built-in Evolver command: As of version 2.29, the Surface Evolver has a built-in command
binary_off_filethat creates a binary frame file for the current surface. The syntax is
binary_off_file stringwhere string is a double-quoted string, a string variable, or a string-producing expression, typically using sprintf. Here is a simple Evolver script for producing a movie with one frame for each iteration:
for ( frame := 1 ; frame <= 1000 ; frame += 1 ) { binary_off_file sprintf "frame-%04d.offb", frame; g; }Note that the %04d format generates zero-padded numbers in the frame file name, so alphabetical order is the same as numerical order.
The facets and edges that are included in the frame file are those for which the facet or edge "show" expressions are true. By default, all facets are shown, and all special edges (edges that are fixed, valence not two, on constraints, or on boundaries). Facet and edge colors are also recorded.
If special viewing modes are in effect, such as torus connected bodies, torus clipped, view transforms, or clipping planes, then these will also affect the facets and edges generated by binary_off_file.
If you have assigned values to the facets' "opacity" attribute, then the opacity format will be used, and evmovie will show translucent surfaces.
Evolver script for ASCII frame files: If, for some reason the built-in binary_off_file command does not suit your needs, you can create your own frame files. Here is a sample Evolver script:
// Surface Evolver command to print ascii OFF file. // usage: // do_off >>> "filename.off" // Surface Evolver command to print OFF file in a modified // ascii format. Difference is each facet is followed by // one color index integer rather than integer plus color components. define vertex attribute off_number integer; do_off := { local inx,fcount,ecount; // Consecutive index numbers for vertices inx := 0; foreach vertex vv do { vv.off_number := inx; inx += 1; }; fcount := sum(facet,show); ecount := sum(edge,show); // file header is ascii printf "OFF\n"; printf "%d %d %d\n",vertex_count,fcount,ecount; // vertex list foreach vertex do { printf "%f %f %f\n",x,y,z }; // triangle list foreach facet ff where ff.show do { printf "%d ",3; foreach ff.vertex vv do printf "%d ",vv.off_number; printf "%d\n",ff.color; }; // edge list foreach edge ee where ee.show do { printf "%d ",2; foreach ee.vertex vv do printf "%d ",vv.off_number; printf "%d\n",ee.color; }; }
Evolver script for binary frame files
// offb.cmd // Surface Evolver command to print OFF file in a modified // binary format. Difference is each facet is followed by // one color index integer rather than integer plus color components. // usage: // do_off >>> "filename.off" define vertex attribute off_number integer do_offb := { local inx,fcount,ecount; // Consecutive index numbers for vertices inx := 0; foreach vertex vv do { vv.off_number := inx; inx += 1; }; fcount := sum(facet,show); ecount := sum(edge,show); // file header is ascii printf "OFF BINARY\n"; binary_printf "%ld%ld%ld",vertex_count,fcount,ecount; // vertex list foreach vertex do { binary_printf "%f%f%f",x,y,z }; // triangle list foreach facet ff where ff.show do { binary_printf "%ld",3; foreach ff.vertex vv do binary_printf "%ld",vv.off_number; binary_printf "%ld",ff.color; }; // edge list foreach edge ee where ee.show do { binary_printf "%ld",2; foreach ee.vertex vv do binary_printf "%ld",vv.off_number; binary_printf "%ld",ee.color; }; }Frame files by other programs: Frame files may be generated by other programs such as Mathematica or CAD programs, as long as you can get them to output files in one of the frame file formats described below.
There are two formats: ASCII text, and binary. The ASCII format is good for developing frame file generating software, since it is easier to debug, but the binary format is more compact and quicker to load into evmovie.
The color indices used are copied from the Surface Evolver, and are:
0 BLACK, 1 BLUE, 2 GREEN, 3 CYAN, 4 RED, 5 MAGENTA, 6 BROWN, 7 LIGHTGRAY, 8 DARKGRAY, 9 LIGHTBLUE, 10 LIGHTGREEN, 11 LIGHTCYAN, 12 LIGHTRED, 13 LIGHTMAGENTA, 14 YELLOW, 15 WHITEASCII file format:
line 1: OFF with optional parameters on the same line: OPACITY if the "opacity" facet attribute is being used BBOX if the bounding box is to be shown at startup LOOP if the looping movie mode is to be run at startup CYCLE if the cycle movie mode is to be run at startup PLAY if the forward movie mode is to be run at startup CLIP if clip mode is to be enabled at startup. Must be followed by the four coefficients for the clip plane, as in Evolver's clip_coeff. SMOOTH if smooth shading is to be enabled at startup SHOW_EDGES if all facet edges are to be shown at startup FACETS_OFF if facets are not to be shown at startup VIEW gives the initial view matrix. Must be followed by 16 numbers, the components of the view matrix. Can use values put out by the Evolver's "print view_matrix" command. Example (the default view): VIEW 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 TEXT gives a string of text to be displayed in the frame. Must be followed by x,y window coordinates for the lower left start of the text, then a font size number (also relative to window size), and a quoted string of text. Example: TEXT 0.01 0.01 0.03 "Hello World!" line 2: nv nf ne where nv is the number of vertices, nf is the number of facets ne is the number of edges (yes, edges last) lines 3 to 2+nv: three floating point numbers per line, coordinates of a vertex lines 3+nv to 2+nv+nf: 3 v1 v2 v3 c op where 3 is the number of vertices in the polygon (from OFF format, but 3 is the only number evmovie recognizes), v1, v2, v3 are the vertex numbers of the facet in the vertex list, using 0 based indexing, c is the color of the facet, an integer from 0 to 15, being the same color number used by Evolver. op is the opacity, value 0 for clear to 1 for opaque, if OPACITY is used. lines 3+nv+nf to 2+nv+nf+ne: 2 v1 v2 c where 2 is the number of vertices in the edge, v1, v2 are the vertex numbers of the edge ends in the vertex list, using 0 based indexing, c is the color of the facet, an integer from 0 to 15, being the same color number used by Evolver. Only special edges that should always be shown should be in this list.Binary file format:
Line 1 is ascii, ending with newline: OFF BINARY with options on the first line same as in ASCII format. The rest of the file is the same format as the ASCII version, but with 4-byte ints and 4-byte floats and no newlines. So the length of the file after the first line is 3 + nv*4*3 + nf*4*5 + ne*4*4 (or nf*4*6 if opacity is used). The program tries to automatically detect big-endian vs little-endian format by seeing which gives the correct filesize.