Contents:
Programmer: Ken Brakke, Susquhanna University, Selinsgrove, PA 17870, USA, brakke@susqu.edu.
evmovie testmovie\*.offbTo make the evmovie program available for your movie files:
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.
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, ...
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_file that creates a binary frame file for the current surface. The syntax is
binary_off_file string
where 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
or if the "opacity" facet attribute is being used
OFF OPACITY
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
or, if opacity is used,
OFF BINARY OPACITY
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.