Developer Documentation
Loading...
Searching...
No Matches
decimater.cc
1using namespace OpenMesh;
2
4typedef Decimater::DecimaterT<Mesh> Decimater;
5typedef Decimater::ModQuadricT<Mesh>::Handle HModQuadric;
6
7Mesh mesh; // a mesh object
8Decimater decimater(mesh); // a decimater object, connected to a mesh
9HModQuadric hModQuadric; // use a quadric module
10
11decimater.add(hModQuadric); // register module at the decimater
12std::cout << decimater.module(hModQuadric).name() << std::endl; // module access
13
14/*
15 * since we need exactly one priority module (non-binary)
16 * we have to call set_binary(false) for our priority module
17 * in the case of HModQuadric, unset_max_err() calls set_binary(false) internally
18 */
19decimater.module(hModQuadric).unset_max_err();
20
21decimater.initialize();
22decimater.decimate();
23
24// after decimation: remove decimated elements from the mesh
25mesh.garbage_collection();