c++ - 如何将三角孔补丁转换为表面网格?

标签 c++ computational-geometry cgal

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

我正在尝试使用两个不同的补丁部分填充我的网格中的一个洞。我有边界上所有点的顶点位置(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));

最佳答案

关于c++ - 如何将三角孔补丁转换为表面网格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55756038/

相关文章:

c++ - Cgal二次规划目标函数

c++ - CGAL新手问题: Which segments intersect?

c++ - 类中的函数指针

algorithm - 在现有轮廓线之间插入缺失的轮廓线

python - 剪裁 voronoi 图 python

c++ - 从表面减去封闭网格(CGAL?)

c++ - 加载共享库时出错 : libboost_system. so.1.45.0:无法打开共享对象文件:没有这样的文件或目录

c++ - 从另一个线程发出信号的最快方法

c++ - 未定义对 PQfinish 的引用,即使包含库等

algorithm - 四面体网格中的点位置