diff --git a/src/main.cpp b/src/main.cpp index c668feb..2153fac 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -120,11 +120,21 @@ void stats_normal_deviation(MyMesh &mesh) { } +void stats_dihedral_angles(MyMesh &mesh) { + mesh.update_normals(); + for (size_t i = 0; i < mesh.n_halfedges(); i++) { + MyMesh::HalfedgeHandle heh = mesh.halfedge_handle(i); + std::cout << mesh.calc_dihedral_angle_fast(heh) * 180.0 / PI << " "; + } + std::cout << std::endl; +} + + int main(int argc, char *argv[]) { using namespace std; if (argc != 2 && argc != 3) { - cerr << "Utilisation : " << argv[0] << " fichier.obj [surface|valence|deviation]" << endl; + cerr << "Utilisation : " << argv[0] << " fichier.obj [surface|valence|deviation|dièdre]" << endl; return 1; } MyMesh mesh; @@ -152,6 +162,8 @@ int main(int argc, char *argv[]) { stats_n_neighbors(mesh); else if (cmd == "deviation") stats_normal_deviation(mesh); + else if (cmd == "dièdre") + stats_dihedral_angles(mesh); else { cerr << "Commande inconnue : " << cmd << endl; return 1;