Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] struggling opening off file

Subject: CGAL users discussion list

List archive

[cgal-discuss] struggling opening off file


Chronological Thread 
  • From: Alexandre Lapene <>
  • To:
  • Subject: [cgal-discuss] struggling opening off file
  • Date: Tue, 25 Nov 2014 11:11:20 -0800 (PST)

Hi,

I'm struggling opening an off file that I have generated.
Here is the simple piece of work that does not work

Polyhedron mesh;
std::ifstream input("file.off");
if (!input) {
cerr << "Cannot open file!\n";
return EXIT_FAILURE;
}
if (!(input >> mesh) || mesh.empty()) {
std::cerr << "Not a valid off file." << std::endl;
return EXIT_FAILURE;
}

The code exists at the second test as the file is found but appears not
correct and it's seen as empty.
Below is my off file

OFF
8 6 0

5.59796 5.80733 -0.000205
5.94914 5.35456 -0.000225
5.94926 5.35465 0.094035
5.59808 5.80742 0.094055
5.54866 5.76909 -0.000107
5.89984 5.31632 -0.000127
5.89996 5.31641 0.094133
5.54878 5.76918 0.094153
4 0 3 2 1
4 4 7 6 5
4 1 0 4 5
4 3 2 6 7
4 0 3 7 4
4 1 2 6 5

Just a simple box. I have tried to open it and save it as off in Meshlab but
it does change the result.
I have also tried with a cube

OFF
8 6 0

0 1 0
0 0 0
0 0 1
1 0 0
1 0 1
0 1 1
1 1 0
1 1 1
4 3 4 2 1
4 0 6 3 1
4 6 0 5 7
4 5 0 1 2
4 7 5 2 4
4 7 4 3 6

It works with this cube.

So, my question is what's wrong with my off file? And is there some debug
info I can access to know what's wrong in general in one off file I would
like to open and use

Thanks in advance













--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/struggling-opening-off-file-tp4660163.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page