/Fast-Quadric-Mesh-Simplification

Mesh triangle reduction using quadrics

Primary LanguageCMIT LicenseMIT

Fast-Quadric-Mesh-Simplification

Summary

Since I couldn't find any code that's fast, memory efficient, free and for high quality, I developed my version of the quadric based edge collapse mesh simplification method. It uses a threshold to determine which triangles to delete, which avoids sorting but might lead to lesser quality. It is about four times faster than Meshlab. Note that this algorithm is fast and works well for watertight volumes without without thin sections.

img

Compiling and Usage

You can compile and execute the minimal command line program:

git clone git@github.com:sp4cerat/Fast-Quadric-Mesh-Simplification.git
cd Fast-Quadric-Mesh-Simplification/src.cmd
make
./simplify ../data/wall.obj ./simple.obj 0.05

Running the simplify executable without any arguments will provide further helpful usage instructions.

This simple program simplifies meshes stored in OBJ format. This is a simple reader/writer, so don't try to use this tool when multiple objects are embedded into one file.

Note that you can compile with make sanitize to create an executable with debugging capabilities. Finally, you can compile with make wasm to create WebAssembly code, as showcased live demo web page.

For Developers

The functionality is contained in Simplify.h. The function to call is simplify_mesh(target_count). The code is kept pretty slim, so the main method has just around 400 lines of code.

Translations, Implementations and Live Demos