31 #include "DGtal/base/Common.h"
33 #include "DGtal/io/readers/MeshReader.h"
34 #include "DGtal/io/writers/MeshWriter.h"
35 #include "DGtal/io/Display3D.h"
36 #include "DGtal/shapes/Mesh.h"
42 using namespace DGtal;
74 int main(
int argc,
char** argv )
78 std::string inputFileName;
79 std::string outputFileName {
"result.off"};
81 app.description(
"Convert OFS file into OFF mesh format.");
82 app.add_option(
"-i,--input,1", inputFileName,
"ofs file (.ofs)." )
84 ->check(CLI::ExistingFile);
85 app.add_option(
"-o,--output,2", outputFileName,
"ofs file (.off)");
87 app.get_formatter()->column_width(40);
88 CLI11_PARSE(app, argc, argv);
92 Mesh<Z3i::RealPoint> anImportedMesh(
true);
93 bool import = anImportedMesh << inputFileName;
94 bool exported = anImportedMesh >> outputFileName;
95 if(!
import || !exported){
96 trace.info() <<
"Conversion failed: " << (exported?
"Reading OFS failed. ":
"Export OFF failed. ") << std::endl;
99 trace.info() <<
"[done]. "<< std::endl;