Page 1 of 1
asking for *.bin file for test
Posted: Fri Mar 11, 2011 1:43 am
by hanyan0125
Dear sir:
I'm a new user of CloudCompare,I want to test the software .But I could not open my binfile,so I search it in this web and couldn't find any.I notice it in the FILE I/O page that it's CloudCompare own format .But I could find some example data in the website.Could anyone do me a favor to help me about that?Thank you so much!
Re: asking for *.bin file for test
Posted: Fri Mar 11, 2011 8:16 pm
by daniel
Hello,
in fact, people generally import their own data from an ASCII file (one point per line - 'x y z' coordinates in clear text). Once loaded, they can save it in 'bin' format to make smaller files and faster loading.
However, you'll find in attach such a 'bin' file.
Daniel
Re: asking for *.bin file for test
Posted: Sun Mar 13, 2011 1:26 pm
by hanyan0125
daniel wrote:Hello,
in fact, people generally import their own data from an ASCII file (one point per line - 'x y z' coordinates in clear text). Once loaded, they can save it in 'bin' format to make smaller files and faster loading.
However, you'll find in attach such a 'bin' file.
Daniel
Daniel:
Thank you very much for your test data! By the way, my original purpose is to write this kind of binfile in my other software ,so I can do less converting works while using CloudCompare . Could you please explain the structure of this binfile to me ?
Thank you again for your attention!
Re: asking for *.bin file for test
Posted: Mon Mar 14, 2011 9:09 am
by daniel
You'd best look directly at 'qCC\fileIO\BinFilter.cpp (the 'saveToOpenedFile' and 'WriteListHeader' methods).
the content is as following:
- [4 bytes - unsigned int] the number of clouds stored in the file
- then for each cloud:
- [4 bytes - unsigned int] the number of points in the cloud
- [1 byte - unsigned char] binary flags with the following bits (from least to most significant) :
- bit 1: always '1'
- bit 2: cloud has colors
- bit 3: cloud has normals
- bit 4: cloud has an associated scalar field (per-point scalar value)
- bit 5-8: not used (0)
- then for each point
- [3*4 bytes - floats] X,Y,Z coordinates
- if cloud has colors: [3*1 bytes - unsigned char] RGB values
- if cloud has normals: [3*4 bytes - floats] (Nx,Ny,Nz) values
- if cloud has a scalar field: [4 bytes - float] scalar value
That's it!