我可能不理解Mesh_feature_extractor边框是如何工作的。我使用的是一个有8个顶点的完美立方体,当我调用get_nb_borders()时,它返回1,我认为这是错误的(也许我对“边界”的理解是错误的)。有人能解释一下边界是什么吗?
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();发布于 2017-07-13 16:20:49
我那不好的1面是顺时针的,其余的是逆时针的。
https://stackoverflow.com/questions/45072833
复制相似问题