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