MeshFrame: a Light Weighted Dynamic Mesh Processing FrameWork

Overview

MeshFrame is a light-weighted, efficient and header-only mesh processing frame work. Its speed is superior to other state-of-the-art libraries like OpenMesh, MeshLab or CGAL. It supports dynamic mesh structure editing, supports runtime dynamic properties whose speed is no inferior to static properties (which are attributes added to C++ classes), supports triangle/tetrahedral mesh, with a built-in viewer, and also includes a number of grid processing algorithms. This link to its github page.

A Dynamic Mesh Processing Library

There are two layers of what "dymanic" means: runtime dynamic properties of mesh elements and dyanmic mesh structure editing.

Dynamic Properties

MeshFrame offers a convenient way to add dynamic properties to mesh elements (vertices, faces, edges, halfedges, tetrahedrals). As in constrast to static way that adds member attributes to inherited classes, the dynamic is much more flexible and convenient because it can be done in the runtime without relying re-compiling. However, accessing dynamic properties is generally considered less efficient in comparison to static properties. Because in most of the implementation, accessing the dynamic properties requires a dictionary search, whose complexity is non-constant. However, in our implementation, we managed to reduce the complexity of accessing dynamic properties to constant. This is achieved through PropHandle. Adding a property to a mesh element is as easy as:

	Mesh m;
	VPropHandle vPropHandle; 
	m.addVProp(vPropHandle);
					

Accessing the added property is as easy as:

	for (M::VPtr pV : m.vertices()) {
		int & idx = m.getVProp(vIntHandles[NUM_PROPS -1], pV);
		idx = k++;
	}
					

Thanks to our efficient memory management techniques, the speed of accesing our dynamic property is no inferior to accessing static property like:

	class MyVertex : public CVertex
	{
	public:		
		float property;

	};
					

Here we compare the speed of our dynamic property with static property and another dynamic property implementation by OpenMesh:

Dynamic Structure Editing

MeshFrame supports dynamic mesh structure editing in the runtime. It has built-in command to do common structural editing like edge collapse, edge split or vertex split:

>

And the command for doing this is very simple, MeshFrame will handle the complex memory management and the halfedge structure change behind the scene:

DMesh m;
DMEdge* eToCollapse = selectEdge();
m.edgecollapse(e);
DMEdge* eToSplit = selectEdge();
m.edgesplit(e, 0.5); // the second parameter tells where you split the selected edge
				

Here we compare the speed of our QEM implementation with the MeshLab's implementation. The comparison was done on a dataset contains 40 obj meshes, including various types and topology. We can see that our implementation is about 3 times faster than MeshLab's implementation.

Representative Images

The images bellow can be clicked on to go on full screen.