Files
igl/tutorial/101_FileIO/main.cpp
T
Daniel Crispell c861c711a0 Enable out of source tutorial build
Use CMake's "configure_file" functionality to store path to the tutorial
shared directory, enabling tutorial executables build out of source to
correctly find the data files.


Former-commit-id: a0eed05e8b
2015-10-09 22:52:39 -04:00

21 lines
522 B
C++
Executable File

#include <igl/readOFF.h>
#include <igl/writeOBJ.h>
#include <iostream>
#include "tutorial_shared_path.h"
Eigen::MatrixXd V;
Eigen::MatrixXi F;
int main(int argc, char *argv[])
{
// Load a mesh in OFF format
igl::readOFF(tutorial_shared_path + "/cube.off", V, F);
// Print the vertices and faces matrices
std::cout << "Vertices: " << std::endl << V << std::endl;
std::cout << "Faces: " << std::endl << F << std::endl;
// Save the mesh in OBJ format
igl::writeOBJ("cube.obj",V,F);
}