mkazhdan / PoissonRecon

Poisson Surface Reconstruction
MIT License
1.51k stars 422 forks source link

The --grid parameter #263

Open jcl1798 opened 1 year ago

jcl1798 commented 1 year ago

Can the professor explain the meaning of the --grid parameter? I don't know how to use the returned binary file?

mkazhdan commented 1 year ago

As per the description: "The file is written out in binary, with the first 4 bytes corresponding to the (integer) sampling resolution, 2^d, and the next 4 x 2^d x 2^d x ... bytes corresponding to the (single precision) floating point values of the implicit function."

Concretely, assuming "fp" is the file pointer (opened in binary mode), the read of the file may look like: int res; fread( &res , sizeof(int) , 1 , fp ); float values = new float[resresres]; fread( values , sizeof(float) , resresres , fp ); Then, the (i,j,k)-th entry of the grid will be "values[i+jres+kresres]".