forked from alecjacobson/geometry-processing-introduction
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (22 loc) · 699 Bytes
/
main.cpp
File metadata and controls
26 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "edges.h"
#include "euler_characteristic.h"
#include <igl/read_triangle_mesh.h>
#include <igl/viewer/Viewer.h>
int main(int argc, char *argv[])
{
Eigen::MatrixXd V;
Eigen::MatrixXi F;
// Load in a mesh
igl::read_triangle_mesh(argc>1 ? argv[1] : "../shared/data/bunny.off", V, F);
Eigen::MatrixXi E = edges(F);
int Chi = euler_characteristic(F);
std::cout<<"Edge list E is "<<E.rows()<<"x"<<E.cols()<<std::endl;
std::cout<<"Euler Characteristic: "<<Chi<<std::endl;
// Create a libigl Viewer object
igl::viewer::Viewer viewer;
// Set the vertices and faces for the viewer
viewer.data.set_mesh(V, F);
// Launch a viewer instance
viewer.launch();
return 0;
}