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 re-construction
G. Xu, C. Bajaj, H. Huang
C1 Modeling with A-patches from Rational Trivariate Functions
Computer Aided Geometric Design, 18:3(2001), 221-243.
C. Bajaj, J. Chen, G. Xu
Modeling with Cubic A-patches
ACM Transactions on Graphics, 14:2, (1995), 103-133.
C. Bajaj, G. Xu
Smooth Multiresolution Reconstruction of Free-Form 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), 89-112.
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.
- C1 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 /ccv-pub/xuguo/data/Tri_raw
- .glx file with normal. For the format of this kind of file, see the files in /ccv-pub/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 /ccv-pub/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:
In general, the third one is better than the first two. The first one is the fastest, the last one the slowest.
- 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.
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.
- SharpAngle -- The input angle that controls the sharpness.
Decimation: There are two methods:
- Dan's method
- 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
- 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 re-triangulation 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 re-triangulation after one point is removed. There are three ways it can be used.
- ReTriWays = 1, re-triangulate the hole in a recursive way by connecting two adjacent edges that have minimal angles.
- ReTriWays = 2, re-triangulate the hole recursively by subdividing the hole into two holes by connecting two points that have the shortest distance.
- ReTriWays = 3, re-triangulate 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
- Piecewise Draw -- show the result piecewise
- Save final mesh -- save the final result into file /ccv-pub/xugo/data/Triangles/tmp2
- Subdivide times -- the number of subdivision times
- Triangular surface fit (Patch fit)
- 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 /ccv-pub/xuguo/data/Triangles/tmp3.glx
- Resolution -- display resolution.
- Power -- the power in blending the rational function. See paper for details.
- BgnIsoCrvValue -- the left end point of the iso-value interval for the function on the surface.
- EndIsoCrvValue -- the right end point of the iso-value interval for the function on the surface.
- NumbOfIsoCurve -- number of the iso-curves 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 iso-region on the domain surface.
- 2 -- Draw the iso-region in the space (normal direction)
- 3 -- Draw both.
- 4 -- Draw the iso-curve on the domain surface
- 5 -- Draw the iso-curve 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 iso-region
- 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 Iso-surface value.
- EndIsoSufValue -- end iso-surface value.
- NumbOfIsoSufas -- The number of iso-surfaces.
- InFittingError -- The error control of the least square fit.
- InFittingDegre -- The degree of fitting polynomial.
- Fit Ways(0--3) -- 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 C0 fit the patch,
- then use degree "In-Fitting Degree" rational (inner freedom) to make the whole function (original + inner freedom) to fit the (2/2) rational patch with C1. This seems to be the best at present.
- OutFittingDegre -- The degree of out fitting polynomial (see the explanation of Fit Ways)
In general, the user does not need to concern themselves about the output when the program is executed. But there is some output available:
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.
- The decimated result is written to /ccv-pub/xuguo/data/Triangles/tmp. The file is a .glx type of file.
- The Hermite subdivision result is at /ccv-pub/xuguo/data/Triangles/tmp2
- The surface fit result (the triangulation) is written at /ccv-pub/xuguo/data/Triangles/tmp3.glx
- The rational fitting result is at /ccv-pub/xuguo/tmp