首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mesh_feature_extractor未返回正确的边框

Mesh_feature_extractor未返回正确的边框
EN

Stack Overflow用户
提问于 2017-07-13 14:21:41
回答 1查看 26关注 0票数 0

我可能不理解Mesh_feature_extractor边框是如何工作的。我使用的是一个有8个顶点的完美立方体,当我调用get_nb_borders()时,它返回1,我认为这是错误的(也许我对“边界”的理解是错误的)。有人能解释一下边界是什么吗?

代码语言:javascript
复制
    std::vector<Vector3> tempVertices;
    tempVertices.push_back(Vector3(-50, 50, -50));
    tempVertices.push_back(Vector3(-50, 50, 50));
    tempVertices.push_back(Vector3(50, 50, 50));
    tempVertices.push_back(Vector3(50, 50, -50));

    tempVertices.push_back(Vector3(-50, -50, -50));
    tempVertices.push_back(Vector3(-50, -50, 50));
    tempVertices.push_back(Vector3(50, -50, 50));
    tempVertices.push_back(Vector3(50, -50, -50));

    std::vector<int32> tempIndices;
    tempIndices.push_back(0);   tempIndices.push_back(2);   tempIndices.push_back(1);
    tempIndices.push_back(0);   tempIndices.push_back(3);   tempIndices.push_back(2);

    tempIndices.push_back(4);   tempIndices.push_back(6);   tempIndices.push_back(5);
    tempIndices.push_back(4);   tempIndices.push_back(7);   tempIndices.push_back(6);

    tempIndices.push_back(4);   tempIndices.push_back(3);   tempIndices.push_back(0);
    tempIndices.push_back(4);   tempIndices.push_back(7);   tempIndices.push_back(3);

    tempIndices.push_back(7);   tempIndices.push_back(2);   tempIndices.push_back(3);
    tempIndices.push_back(7);   tempIndices.push_back(6);   tempIndices.push_back(2);

    tempIndices.push_back(6);   tempIndices.push_back(1);   tempIndices.push_back(2);
    tempIndices.push_back(6);   tempIndices.push_back(5);   tempIndices.push_back(1);

    tempIndices.push_back(5);   tempIndices.push_back(0);   tempIndices.push_back(1);
    tempIndices.push_back(5);   tempIndices.push_back(4);   tempIndices.push_back(0);

    typedef Polyhedron::HalfedgeDS  HalfedgeDS;

    Polyhedron mesh;
    CGALTriangleBuilder<HalfedgeDS> triangle(tempVertices, tempIndices);
    mesh.delegate(triangle);

    typedef CGAL::Parameterization_polyhedron_adaptor_3<Polyhedron> Parameterization_polyhedron_adaptor;
    Parameterization_polyhedron_adaptor mesh_adaptor(mesh);

    // Helper class to compute genus or extract borders
    typedef CGAL::Parameterization_mesh_feature_extractor<Parameterization_polyhedron_adaptor> Mesh_feature_extractor;


    // Extract mesh borders and compute genus
    Mesh_feature_extractor feature_extractor(mesh_adaptor);
    int nb_borders = feature_extractor.get_nb_borders();
    int genus = feature_extractor.get_genus();
EN

回答 1

Stack Overflow用户

发布于 2017-07-13 16:20:49

我那不好的1面是顺时针的,其余的是逆时针的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/45072833

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档