I am trying to create a gray-scale .inr image for the cgal library, but I am having trouble with the file format.
This seems to be the best description of the format, but it does not look like it is complete and only talk about the header, not the data itself.
This seems to have a bit more information about the format, but unfortunately it is in French.
What I am trying to do is to represent an object as a 3D array filled with boolean, so a position would have value 1 if it is inside the object and 0 if it is outside.
What I have done for now, based on the second link if I understood it correctly, is to write after the header each z plane on a line, with the next z plane on a new line.
So I have the x values of the columns on a line representing the first row, then the x values of the second row on the same line, and like that y times till the last row. I then jump a line for the new z plane and write the data in the same way.
I have created the following .inr file, but when I try to mesh it, the result is a cube instead of a cylinder, as if cgal (I used mesh_optimization_lloyd_example) did not care about the boolean values and just meshed the whole volume.
I tried looking at the .inr files provided with the examples (like skull_2.9.inr), but while the header was perfectly legible, no text editor could read the image data, which makes me think there might be something more than just writing 0s or 1s.
Is it something about the .inr that is wrong? Or maybe I am using cgal wrong?