Collection of command line programs to process, test, and repair triangle soup meshes.
The following programs found in programs do the following:
Note:
simplifymeshdoes not work currently!
| Program | Arguments | Description |
|---|---|---|
face2faceindex |
<.tri file> |
Takes in a triangle soup .tri file, processes it and outputs a face indexed .face file. |
faceindex2directededge |
<.face file> |
Takes in a face indexed .face file, processes it and outputs a directed edge .diredge file. |
manifoldtest |
<.diredge file> (optional) |
Given a .diredge file, test whether the mesh is manifold, if no file is provided, all .diredge files in the current directory will be tested. An output file manifold_test_results.txt outputs an manifold errors in any of the meshes describing the first encountered reasons as to why the mesh is not manifold, along with the time taken to test if the mesh is manifold or how long it took before it failed. |
meshrepair |
<.tri file> |
Given a .tri file, repair any holes in the mesh and ensure it results in a manifold mesh, and output the repaired mesh to a .tri file. |
simplifymesh |
<.diredge file> <iterations> |
Simplfies a given .diredge mesh using the standard greedy algorithm by removing the vertex with the smallest Gaussian curvature calculated using the Discrete Laplace-Beltrami operator. |
Example input triangle soup meshes are provided in the models directory. Some are manifold, some are not and some need obvious repair.
A small mesh visualiser is provided in the triangle_renderer directory, the instructions for compiling and using it are found within the directory.
If instead you want to use Blender to view the models, you can uncomment the writeToObj(filename) line at the end of the main function in face2faceindex to write the input .tri file to an .obj file to load into Blender. You can do the same with the resultant file produced by the meshrepair program.
A simple Makefile is given in programs to compile the programs.
| Command | Description |
|---|---|
make <program name.cpp> |
Compiles a given program |
make all |
Compiles all the programs |
make clean |
Cleans the program binaries and produced .tri, .face, and .diredge files. |
A script is provided in programs to quickly process all models in models to .diredge files and then manifold test all of them.