implements statistics computation on dihedral angles

This commit is contained in:
ccolin 2020-10-02 13:19:47 +02:00
parent 6310c2c551
commit 07db041c21
1 changed files with 13 additions and 1 deletions

View File

@ -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;