
Description
Prism is a geometric mesh viewer that also provides mesh processing utilities to provide multiresolution adaptive mesh surface approximations while preserving much of the detail of the original mesh.
 Available for both Linux and Windows.
 3 types of surface normal calculations
 2 methods of mesh decimation
 2 methods of mesh reconstruction

References
G. Xu, C. Bajaj, H. Huang
C^{1} Modeling with Apatches from Rational Trivariate Functions
Computer Aided Geometric Design, 18:3(2001), 221243.
C. Bajaj, J. Chen, G. Xu
Modeling with Cubic Apatches
ACM Transactions on Graphics, 14:2, (1995), 103133.
C. Bajaj, G. Xu
Smooth Multiresolution Reconstruction of FreeForm Fat Surfaces
TICAM Report 99  08, March 1999.
C. Bajaj, G. Xu, R. Holt, A. Netravali
Hierarchical Multiresolution Reconstruction of Shell Surfaces
Computer Aided Geometric Design, 19:2(2002), 89112.

Download

Documentation
The code does the following in sequence:
 Take a triangulated surface data as input
 Computed normal at each vertex.
 Marked some edges as sharp.
 Decimated the triangulated mesh.
 C^{1} fitting with triangular surface patches or do hermite subdivision.
Interfaces and functions
File: Three types of files can be read:
 .raw file without normal. For the format of this kind file, see the files in /ccvpub/xuguo/data/Tri_raw
 .glx file with normal. For the format of this kind of file, see the files in /ccvpub/xuguo/data/Tri_glx
 .raw file could have function value at each vertex. The function is for second surface. For the format of this kind file, see the file /ccvpub/xuguo/data/Tri_raw/headf.raw
Normal_Estmt: There are three ways for estimate the normal from the input. If the input has normal, that is the .glx file, then use original normal. If the data has no normal, then one of the following three way could be chosen:
 Averaging the face normal. The gradient of the second function is also computed in this way.
 Loop's subdivision limit surface normal.
 Least square fit normal.
In general, the third one is better than the first two. The first one is the fastest, the last one the slowest.
MarkSharpEdge: Make the edges that has dihedral angle less than an input angle as sharp. The the vertices related to sharp edges will not be removed in the decimation step.
Input parameters:
 SharpAngle  The input angle that controls the sharpness.
Decimation: There are two methods:
 Dan's method
 Toggle:
 Show POPLY  show the decimated polygon if it is active
 Save NORM  save the decimated resolt with normal if it is active. Otherwise no normal.
 Input parameters:
 Iteration number  out iteration times.
 Aspect Ratio  control the angles of the produced triangles. If the value approaches 1.0, the angles tend to zero. That is, the value is the cosine of the angle.
 Dihedral angle  to control the sharp features, but does not seem to provide much effect. The value is cosine to the angle.
 Control Error  control the geometric error.
 Xu's method
 Toggle:
 Show POPLY  show the decimated polygon if it is active.
 Grouping  group the removed points into each prism during the decimation process.
 Save NORM  save the decimated result with normal if it is active. Otherwise no normal.
 Input parameters:
 Iteration number  out iteration times.
 Control Angle  control the angles of the face normal of a triangle of the retriangulation with the vertex normals.
 Variation Angle  to control the angle variation of the grouped pointâ€™s normal with linear normal.
 Tri_InnerAngle  control the low bound of the inner angle of each triangle.
 ReTriWays  the approaches of the retriangulation after one point is removed. There are three ways it can be used.
 ReTriWays = 1, retriangulate the hole in a recursive way by connecting two adjacent edges that have minimal angles.
 ReTriWays = 2, retriangulate the hole recursively by subdividing the hole into two holes by connecting two points that have the shortest distance.
 ReTriWays = 3, retriangulate the hole recursively by subdividing the hole into two holes by connecting two points that have the shortest geodesic distance.
Construction: There are two methods:
 Hermite subdivision
 Toggle:
 Piecewise Draw  show the result piecewise
 Save final mesh  save the final result into file /ccvpub/xugo/data/Triangles/tmp2
 Parameters:
 Subdivide times  the number of subdivision times
 Triangular surface fit (Patch fit)
 Toggle:
 Piecewise  show the result piecewise.
 Boundcurve  draw the boundary curve of each patch.
 DrawNormal  draw the normal of each vertex.
 Isophotes  draw isophotes on each patch.
 Fit Error  compute the fitting error and show the points
 Save mesh  save the triangular mesh in /ccvpub/xuguo/data/Triangles/tmp3.glx
 Parameters:
 Resolution  display resolution.
 Power  the power in blending the rational function. See paper for details.
 BgnIsoCrvValue  the left end point of the isovalue interval for the function on the surface.
 EndIsoCrvValue  the right end point of the isovalue interval for the function on the surface.
 NumbOfIsoCurve  number of the isocurves of the function on the surface.
 ProjectMethods  the way of drawing the second function:
 0  No second function on the surface is drawn.
 1  Draw the isoregion on the domain surface.
 2  Draw the isoregion in the space (normal direction)
 3  Draw both.
 4  Draw the isocurve on the domain surface
 5  Draw the isocurve in the space (normal direction)
 6  Draw both.
 Project Radius  the radius of projecting the second function in the normal direction.
 Coloring  the ways of shading the isoregion
 1  global shading, [begin,end] > [0,1]
 2  local shading with the same color for each region
 3  local shading with the same color for each region
 4  local shading with the same color for each region
 5  local shading with a different color for each region
 6  Blending shading, [z1,z2] > [0,z2] > [0,1]
 BgnIsoSufValue  begin Isosurface value.
 EndIsoSufValue  end isosurface value.
 NumbOfIsoSufas  The number of isosurfaces.
 InFittingError  The error control of the least square fit.
 InFittingDegre  The degree of fitting polynomial.
 Fit Ways(03)  The way of fitting:
 0  fit without inside data fit and without rational fit inside
 1  do the above and...
 then use (2/2) rational to C^{0} fit the patch,
 then use degree "InFitting Degree" rational (inner freedom) to make the whole function (original + inner freedom) to fit the (2/2) rational patch with C^{1}. This seems to be the best at present.
 OutFittingDegre  The degree of out fitting polynomial (see the explanation of Fit Ways)
The Output
In general, the user does not need to concern themselves about the output when the program is executed. But there is some output available:
 The decimated result is written to /ccvpub/xuguo/data/Triangles/tmp. The file is a .glx type of file.
 The Hermite subdivision result is at /ccvpub/xuguo/data/Triangles/tmp2
 The surface fit result (the triangulation) is written at /ccvpub/xuguo/data/Triangles/tmp3.glx
 The rational fitting result is at /ccvpub/xuguo/tmp
Note that all files are temporary. You need to remember to copy these files to a safe place, as they will be overwritten if this code is executed again.

