mirror of https://github.com/CGAL/cgal
Allow to open more that OFF files
The files are even repaired on the fiy.
This commit is contained in:
parent
7d35d64f1e
commit
21c4aec8b5
|
|
@ -11,6 +11,7 @@
|
||||||
#include <CGAL/IO/File_binary_mesh_3.h>
|
#include <CGAL/IO/File_binary_mesh_3.h>
|
||||||
|
|
||||||
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
@ -91,7 +92,8 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
std::ifstream input(filename);
|
std::ifstream input(filename);
|
||||||
Mesh mesh;
|
Mesh mesh;
|
||||||
if (!input || !(input >> mesh))
|
const bool ok = CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh);
|
||||||
|
if (!ok)
|
||||||
{
|
{
|
||||||
std::cerr << "Not a valid input file." << std::endl;
|
std::cerr << "Not a valid input file." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue