1

最近在使用OpenFlipper的“填洞”插件,已经完全编译好OpenFlipper。但是,当我尝试将填充补丁添加到原始网格时,新网格有大量重复顶点。我使用以下代码执行添加操作:

// filling_patch: newly created filling mesh
// mesh_ori: the original mesh before hole filling

class MeshT::FaceHandle fh;
class MeshT::FaceIter f_it, f_end;
class MeshT::FaceVertexIter fv_it;

for(f_it = filling_patch->faces_begin(), f_end = fill_patch ->faces_end(); f_it != f_end; f_it++)
{
   // ith face
   fh = *f_it;

   // Check whether it is valid
   if(!fh.is_valid())
   {
        return;
   }

   // Store its three vertices
   std::vector<class MeshT::VertexHandle> face_vhandles;
   face_vhandles.clear();

   // Iterate each vertex of this face
   for(fv_it = mesh_ori->fv_iter(fh); fv_it.is_valid(); fv_it++)
   {
        // Get the 3D point
        class MeshT::Point p = filling_patch->point(*fv_it);

        // Add this point to original mesh. Note: vh is a new vertevHandle, differ to *fv_it
        class MeshT::VertexHandle vh = mesh_ori->add_vertex(p);

        face_vhandles.push_back(vh);
   }

   // Save the face to mesh
   mesh_ori->add_face(face_vhandles);
}

所以,我不确定在 OpenMesh 中是否存在可用于解决此问题的现有功能。

有人给我一些建议吗?

非常感谢。

4

0 回答 0