0
Je ne comprends peut-être pas comment la bordure Mesh_feature_extractor fonctionne. J'utilise un cube parfait avec 8 sommets, quand j'appelle get_nb_borders() il renvoie 1, ce qui me semble faux (peut-être que ma compréhension de 'Border' est fausse). Quelqu'un peut-il expliquer ce qu'est une frontière?Mesh_feature_extractor ne renvoie pas la bordure correcte
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();