1
我想使用OpenMesh對網格進行抽取。 我跟着的是在該文檔被陳述的非常例如:OpenMesh Decimater不會減少頂點數
cout << "Vertices: " << mesh->n_vertices() << endl;
DecimaterT<Mesh> decimater(*mesh); // a decimater object, connected to a mesh
ModQuadricT<Mesh>::Handle hModQuadric; // use a quadric module
decimater.add(hModQuadric); // register module at the decimater
decimater.initialize(); // let the decimater initialize the mesh and the
// modules
decimater.decimate_to(15000); // do decimation
cout << "Vertices: " << decimater.mesh().n_vertices() << endl;
decimate_to方法正確地終止並返回56000,這是應該已經崩潰的頂點的數量。
但是,我可以告訴日誌,網格上的頂點數沒有改變。 這怎麼可能?
你做了我的一天。謝謝。你有沒有指向在官方文檔中說明這種行爲的地方?^^ – Lake
@Lake對[刪除幾何元素]有一個一般的解釋(http://www.openmesh.org/media/Documentations/OpenMesh-6.2-文檔/ a00060.html)。不幸的是,'decimate_to'不會觸發垃圾回收這一事實似乎只能通過'DecimaterT.cpp'實現中的源代碼註釋來記錄。 – jsb
@Lake從OpenMesh 6.3開始,文檔已相應更新。 – jsb