implements checking for lonely faces
This commit is contained in:
parent
6f60dc6173
commit
c23aadadf0
25
src/main.cpp
25
src/main.cpp
@ -17,6 +17,22 @@ bool check_faces_are_triangles(MyMesh &mesh) {
|
||||
}
|
||||
|
||||
|
||||
bool check_faces_arent_lonely(MyMesh &mesh) {
|
||||
for (auto f_it = mesh.faces_begin(); f_it != mesh.faces_end(); ++f_it) {
|
||||
auto ff_it = mesh.ff_iter(*f_it);
|
||||
if (!ff_it.is_valid()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
using namespace std;
|
||||
|
||||
@ -34,5 +50,14 @@ int main(int argc, char *argv[]) {
|
||||
cout << "non";
|
||||
}
|
||||
cout << endl;
|
||||
|
||||
cout << "Les faces ont des voisines : ";
|
||||
if (check_faces_arent_lonely(mesh)) {
|
||||
cout << "oui";
|
||||
}
|
||||
else {
|
||||
cout << "non";
|
||||
}
|
||||
cout << endl;
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user