Replace the assertion about n>2 by a if

This commit is contained in:
Maxime Gimeno 2018-12-13 09:17:46 +01:00
parent 31b68de8b2
commit 51f8877e60
1 changed files with 5 additions and 2 deletions

View File

@ -587,11 +587,14 @@ add_face(const VertexRange& vr, Graph& g)
unsigned int n = (unsigned int)vertices.size(); unsigned int n = (unsigned int)vertices.size();
//check that every vertex is unique //check that every vertex is unique
std::sort(vertices.begin(), vertices.end()); std::sort(vertices.begin(), vertices.end());
if(std::adjacent_find(vertices.begin(), vertices.end()) != vertices.end()) if(std::adjacent_find(vertices.begin(), vertices.end()) != vertices.end()){
return boost::graph_traits<Graph>::null_face(); return boost::graph_traits<Graph>::null_face();
}
std::copy(vr.begin(), vr.end(), vertices.begin()); std::copy(vr.begin(), vr.end(), vertices.begin());
// don't allow degenerated faces // don't allow degenerated faces
CGAL_assertion(n > 2); if(n <= 2){
return boost::graph_traits<Graph>::null_face();
}
std::vector<halfedge_descriptor> halfedges(n); std::vector<halfedge_descriptor> halfedges(n);
std::vector<bool> is_new(n); std::vector<bool> is_new(n);