/****************************************************************************** * Recursive Countour Meshing Software * (C)opyright 1996, 1998, 1999 by Chris Weigle * * Revision 1.0.2 05/09/1999 * Modified lex/yacc grammar to remove hard-coded limits on number of * variables or functions that can be handled. This coincided with some * modifications to the Function class header file and could aguably * justify a new major revision number, but I don't feel compelled. * Revision 1.0.1 05/05/1999 * Modified binary read/write calls to use hton/ntoh to aid working on * multiple platform. * Revision 1.0 04/17/1999 * Numerical problems in Contourer::ContourPoint fixed * Revision 0.9 11/27/1998 * * This software may be freely distributed and modified as long as * this notice stays intact. If you find this software useful, * please contact the original author (weigle@cs.unc.edu) as he would * like to hear about it. If you make improvements you think are * of general interest/use, please tell the original author so they * may be considered for inclusion in later revisions. * ******************************************************************************/ This program has been compiled successfully under (OS, compiler): IRIX 6.5, MIPSpro Compilers: Version 7.2.1 Solaris 2.5.1, egcs-2.91.57 (egcs-1.1 release) This program has been checked for memory leaks under: IRIX 6.5 MIPSpro Compilers: Version 7.2.1 (options: -o32 -g) Purify version 4.0.1 IRIX6 (options:-m71-engine) =============================================================================== rcmesh -i -o [-v ] see the README in the parsefile directory binary file containing: 1 int : the dimension, n, of the space and therefore, the number of floats per vector 1 int : the number of functions, f, applied to get the contour and therefore, the number of gradients per point # floats: the remainder of the file is in "polygon soup" format one point is described as: {1 n-vector (the point) + f n-vectors (the gradients)} n+1 of these produce a (n-f)-simplex the number of simplexes is not stored in the file, but can be deduced from n, f, sizeof(float), and the file size. the number of isovalues specified and the values per function if not specified, the isovalue is assumed to be zero if you want to specify the isovalue of the 1st and 4th function, you must give some value (probably 0) to the intermediates. =============================================================================== Parsefiles take the following form: ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- Here is an example (a torus embedded in 4D) ------------------------------------------------------------------------------- /* The variables used, which determines the dimension of the space */ x0 x1 x2 x3 /* The functions used, which determins the dimension of the contour */ eqn0 : x0 * x0 + x2 * x2 - 3.5 eqn1 : x1 * x1 + x3 * x3 - 2.5 /* the variable parameters, range and number of points per axis */ x0_range : -2 2 x0_points : 5 x1_range : -2 2 x1_points : 5 x2_range : -2 2 x2_points : 5 x3_range : -2 2 x3_points : 5 ------------------------------------------------------------------------------- COMMENTS: C-style (/* */) comments are allowed to appear anywhere. WHITESPACE: Use it, enjoy it. It makes life (and debugging) easier. VARIABLES: The allowed variables are x0, x1, x2, x3, x4, x5; they must be used in order and appear first in the file. The dimension of the space to be contoured is determined by which variables are present. The variables are all real (complex number support may appear later). EQUATIONS: Up to five equations are supported (eqn0, eqn1, eqn2, eqn3, eqn4, eqn5). These must appear in order and be followed by a colon. The expressions are evaluated with standard algebraic associativity. The following functions are recognized: + - * / ^ (exponentiation) () sin cos tan abs pow exp log min(X,Y) max(X,Y) The constant PI is also reconized. Note: The symbol % is recognized but it does nothing (actually, it probably causes a bad parse tree to be built). Why is it in there? Why am I not fixing/removing it? I really don't know. PARAMETERS: There are two parameters per variable, range and points (preceed them with _, like x0_points). The specify: range : the min and max values of the variable points: the number of discrete samples along this axis on the initial structured grid; minimum of 2 (min and max), but this isn't checked for correctness (Why not? It would be easy ... I must be lazy). These must be specified in order (range, then points) and for each variable (which also must be in order).