MT JADE
Triangle mesh simplification through vertex decimation with construction of
a Multi-Triangulation.
The program jademt is a modification of jade 1.0
developed by the Visual Computing Group
of the National Research Council (CNR), Pisa, Italy (see
http://vcg.iei.pi.cnr.it/homepage.html).
The code has been modified under the authorization of the
Visual Computing Group
of the National Research Council (CNR), Pisa Italy.
The modification consists of having added calls to functions of the
MT library, necessary to build a Multi-Triangulation,
as well as a mechanism for guaranteeing a consistent orientation
of all triangles generated at any stage of the decimation process.
We gratefully acknowledge the
Visual Computing Group,
CNR, Pisa,
for having provided the code of Jade and authorized its modification.
The source code of Jademt is not distributed because it contains reserved
parts which are property of the Visual Computing Group, CNR, Pisa.
What follows is extracted from the original USERS_MANUAL file provided with
jade 1.0.
General Information
JADE provides a method for simplifying triangular models.
Given an input model and a user-specified error tolerance, the algorithm
generates an output model that attempts to minimize the number of polygons
while staying within the specified error tolerance.
JADE's main features are :
-
approximation error: an accurate estimation of the approximation error
introduced in the simplification process;
-
compression factor: a reduction factor comparable or better the other
approaches, under the same level of approximation;
-
working domain: wide generality, the algorithm manages self intersecting,
not manifold, not orientable mesh;
-
space/time efficency: short simplification time and low memory consumption,
to allow the management of large meshes.
JADE is based on a "decimation approach" which reduces mesh complexity by
removing vertices.
See a
paper
describing JADE.
How to run the program
You can run the program from the command line by typing:
Jademt [Options] InFile OutFile
where InFile is a file in either MSH of IMSH format containing
the input mesh (converters are provided for translating a number of mesh
formats into the MSH format, see mesh formats);
OutFile will contain the final mesh resulting
from the simplification process, in IMSH format.
Avaliable options
- -h
Show an help message
- -p(value)
Set distance to Error threshold to "value"% of bounding box.
With this option the simplification will be executed with
with a global bound of "value"%. (ex. -p1 execute a reduction
with global error bound of 1%).
- -d(value)
Set the percentage decimation algorithm.
"value"% of vertices will be removed form the mesh.
With this option Jade will use the output number of vertices as exit
condition (ex. -d90 execute a 10:1 reduction of the input mesh).
Errors are always calculated as percentage of bounding box diagonal.
Remark:
Options -p and -d are mutually exclusive, the -d
option has precedence over the -p option.
- -e(angle)
Set Internal Edge threshold to ANGLE (degree).
This option set the angle over that a vertex is classified as an
INTERNAL EDGE or INTERNAL CORNER (see paper for an explanation of
vertex classification).
- -r
Do not remove BOUNDARY vertices.
This option preserves all BOUNDARY vertices of the input mesh.
- -f(value)
Use FLIPPING enhance routine:
- 0: No flipping.
- 1: Volume flipping (FAST).
- 2: Patch Distance flipping (BEST).
The flipping algorithm is the CORE technique of JADE.
Use -f1 for fast approximation or -f2 for best reduction.
- -q(value)
Set triangle quality threshold;
This parameter is used to control output triangle quality; it is in the
0-1 interval (greater is better). Good values from 0.1 to 0.25,
default 0.1.
If "value" is too high the speed of the algorithm will decrease and
reduction percentage became poor. On the other hand, if it is too low
the output mesh can contain poor quality triangles.
Where to find the results
A Multi-Triangulation (file output.mtf) and related tile errors
(file output.err) are automatically generated by jademt,
provided that the program is compiled with macro MAKE_MT set
(as specified in the Makefile).
Vertex normals can be added by using the program addnorma
provided in the utilities.
The triangles of the Multi-Triangulation are consistently oriented through
the surface, but in some cases the orientation is not consistent with the
semantics of the data (e.g., the bounding surface of a solid object may
be oriented in such a way that the front side is the one inside the object.
An MT can be reversed by using the program reverse provided in the
utilities.
Remember to reverse the MT before computing its vertex normals.
Mesh Formats
Jade is capable to read and write 2 mesh format:
- the MSH format, a plain binary RAW format;
- the IMSH format, an indexed binary format.
In the MSH format triangles are listed one after another, duplicating common
vertices.
Structure example (MSH format):
X1,Y1,Z1, // First vertex
X2,Y2,Z2, // Second vertex --> First Triangle
X3,Y3,Z3, // Third vertex
...
Xk,Yk,Yk, // First vertex
Xk+1,Yk+1,Zk+1, // Second vertex --> Last Triangle
Xk+2,Yk+2,Zk+2 // Third vertex
No other information is enclosed in this format; all vertex coordinates are
FLOAT values.
The IMSH format contains some additional information an uses half the space
of MSH format listed above.
Structure example (IMSH format):
"INDEXED" // Tag of 7 bytes with the word indexed (all capital letters)
NumVertices // Number of Vertices in this mesh (INTEGER)
X1,Y1,Z1 // Coordinates of the first vertex (FLOATs)
...
Xn,Yn,Zn // Coordinates of the last vertex (FLOATs) n = NumVertices
NumTriangles // Number of Triangles in this mesh (INTEGER)
v1,v2,v3 // Index of vertices used by the first triangle (INTEGERs)
...
vk,vk+1,vk+2 // Index of vertices used by the last triangle (INTEGERs)
Conversion tool
The conversion tool FORM2FORM can manage the following file types:
-----------------------------------------------------------------------
| From | To |
-----------------------------------------------------------------------
| Mesh Optimization *.M format | IMSH |
| IMSH | Mesh Optimization *.M format |
| CyberWare | MSH |
| VTK PolyData | IMSH |
| IMSH | VTK PolyData |
| HIS | IMSH |
| IMSH | MSH |
| HIS | WRL |
| ASCII PLY | IMSH |
| IMSH | ASCII PLY |
-----------------------------------------------------------------------
Not all conversion filters are complete, in some case input files need some
ajdustment for FORM2FORM to work well.
The FORM2FORM tool can also rescale a mesh during conversion.
Other conversion tools can be found at
HTTP://WWW.CYBERWARE.COM.
Conversion Parameters
- -? Show help message
- -a(Value) Scale mesh coordinate by Value
- -o Convert from Hoppe (.m format) to indexed MSH
- -s Convert from indexed MSH to Hoppe (.m format)
- -c Convert from Cyber to MSH (Incomplete, handle only a CyberWare
subformat)
- -v Convert from VTK (only DATASET POLYDATA) to indexed MSH
- -z Convert from indexed MSH to VTK (DATASET POLYDATA)
- -t(Value) Extract from HIS a MSH with Value error bound
- -k Convert from indexed MSH to MSH
- -h Convert from HIS to WRL
- -m Convert from MSH to ASCII PLY
If no option is passed convert from ASCII PLY to MSH.
Conversion options can be combined with the scale option, but if two or more
conversion options are passed in the same command line, only the last will
be performed.