All Projects → ssloy → ultimaille

ssloy / ultimaille

Licence: AGPL-3.0 license
The ultimate mesh library

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects
Roff
2310 projects
CMake
9771 projects

Build Nightly

UltiMaille: the ultimate mesh processing library

This library does not contain any ready-to-execute remeshing algorithms. It simply provides a friendly way to manipulate a surface/volume mesh, it is meant to be used by your geometry processing software.

There are lots of mesh processing libraries in the wild, excellent specimens are:

I am, however, not satisfied with either of those. At the moment of this writing, Geogram, for instance, has 847 thousands (sic!) of lines of code. I strive to make a library under 10K loc able to do common mesh handling tasks for surfaces and volumes. Another reason to create yet-another-mesh-library is that I like explicit types and avoid auto as long as it reasonable. In practice it means that I cannot use libigl for the simple reason that I do not know what this data represents:

Eigen::MatrixXd V;
Eigen::MatrixXi F;

Is it a polygonal surface or a tetrahedral mesh? If surface, is it triangulated or is it a generic polygonal mesh? I simply can not tell... Thus, ultimaille provides several classes that allow to represent meshes:

PointSet
PolyLine
Triangles, Quads, Polygons
Tetrahedra, Hexahedra, Wedges, Pyramids

You can not mix tetrahedra and hexahedra in a single mesh, I believe that it is confusing to do otherwise. If you need a mixed mesh, create a separate mesh for each cell type: these classes allow to share a common set of vertices via a std::shared_ptr.

Common principles

  • This library is meant to have a reasonable performance. It means that I strive to make it as rapid as possible as long as it does not deteriorate the readability of the source code.
  • All the library is built around STL containers (mainly std::vector<int>), normally it will have no malloc/free/new/delete instructions.
  • Despite that, there will be no size_t and iterator:: in the code. An int is an int. Period.
  • There will be as little templates as it is reasonable, the default data types are int and double.

Compile and run unit tests:

git clone --recurse-submodules https://github.com/ssloy/ultimaille.git &&
cd ultimaille &&
mkdir build &&
cd build &&
cmake -DUM_UNIT_TESTS:BOOL=ON .. &&
make -j &&
cd tests && 
ctest
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].