Halfedge Mesh Library
by Xianfeng Gu, based on An introduction to solid modeling
This webpage has been translated to Romannian by Aleksandra Seremina, please see the Romannian version.
Mesh library is a general purpose geometric mesh library. It has been tested for progressive simplification, silhouette tracing, gaussian curvature calculation applications.
The main features
- Support off/noff file format for I/O.
- Keep manifold structure of the triangular mesh.
- Support edge collapse and vertex split function, which is crutial for progressive mesh simplification.
- Offering heap sort.
- Although current version only support triangular mesh, it is pretty straight forward to generalize it to support any mesh with aritrary sided faces.
- The library is coded in c concerning the efficiency, but it is written
in c++ style.
- Read from noff file, to build up mesh structure.
- For each face, you can access all half edges on it.
- For each half edge, you can access the edge it is attached on, and the
starting and ending vertices of it.
- For each edge, you can access all faces adjacent to it, and all half
edges attached to it.
- For each vertex, you can access all half edges , all faces and all vertices incident to it.
- Each halfedge can collapse, and extended back.
- A general viewer program is included.
- A universial node structure is defined.
- A heap sort tool is included.
All faces of the mesh must be triangle. Because all the datatstructures
are based on double linked list, it is straight forward to generalize
the library for arbitrary sided faces.
Compile and Make on Unix/Linux
- unzip the file, untar the file
- enter meshlib/lib, change compiler and pathes in Makefile, type make to build libmesh.a
- enter meshlib/viewer , change compiler and pathes in Makefile, type make to build the viewer
Compile and Build on Windows
- unzip the meshlib.zip file,
- enter meshlib/MeshViewer, double click on MeshViewer.sln
- Set "Command Arugments" to "bunny_nf4000.noff 10", Set "Working Directory" to "..\..\meshes"
- set the include path and lib path to be meshlib/lib
- include the header files mesh.h and funcs.h
- add link to -lmesh
- read the viewer code to get start.
- Whenever you want to go through a list, check if the head of the list is null.
- Make little procedure to visualize the neighborhood of a vertex is always helpful.
- Make little procedure to visualize the process of edge collapse and vertex split is helpful.
- Use universial node and heap sort will be efficient.
- If you think the accessing linked list is too slow, add index array for the lists.
Available source in Harvard Graphics Archive
- countour library code
- matrix rectify code
- much more mesh models
- convex hull,voroni diagram and medial axis code
New feature for version 1.01
- Add a mesh simplifier program, which demostrates how to use HalfEdge collapse and heap sort to simplify mesh.
- Add HalfEdgeMergeable() to test if the mesh is a manifold after collapsing
- usage for version 1.01
If you have any question, please contact firstname.lastname@example.org. I will
appreciate it very much if you inform me any bugs or give me some comments.