如何将三角孔贴片转换为曲面网格

How to convert a triangulated hole patch to a surface mesh?

本文关键字:曲面 网格 转换 孔贴片 三角      更新时间:2023-10-16

我有一个带有顶点和三角形的三角形孔补丁。现在如何将其转换为曲面网格?

我正在尝试使用两个不同的补丁部分填充网格中的一个孔。我有边界上所有点的顶点位置(z=0 的点(。使用它们,我使用以下代码对孔进行了三角测量(来自 https://doc.cgal.org/latest/Polygon_mesh_processing/Polygon_mesh_processing_2triangulate_polyline_example_8cpp-example.html(

    std::vector<PointCGAL> polyline;
Mesh::Property_map<vertex_descriptor, std::string> name;
Mesh::Property_map<vertex_descriptor, PointCGAL> location = 
    mesh1.points();
BOOST_FOREACH(vertex_descriptor vd, mesh1.vertices()) {
    if (location[vd].z() < 0.00001)
    {
        std::cout << "on Boundary" << endl;
        polyline.push_back(PointCGAL(location[vd].x(), 
    location[vd].y(), location[vd].z()));
    }
    std::cout << location[vd] << std::endl;
}
typedef CGAL::Triple<int, int, int> Triangle_int;
std::vector<Triangle_int> patch;
patch.reserve(polyline.size() - 2); // there will be exactly n-2 
    triangles in the patch
CGAL::Polygon_mesh_processing::triangulate_hole_polyline(
    polyline,
    std::back_inserter(patch));

看看函数 polygon_soup_to_polygon_mesh((