CC *.bin file Content

Feel free to ask any question here
Post Reply
CmdNomad
Posts: 1
Joined: Thu Jul 28, 2016 9:31 am

CC *.bin file Content

Post by CmdNomad »

Hi,
id like to visualise a point cloud and some contour lines i created with the cross section tool on a Power Wall.
But first i have to write a converter for it, so id like to ask how the Poly Lines which built the Contour are written in the .bin file.
I allready found this: http://www.danielgm.net/cc/forum/viewtopic.php?t=50
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
Which helped me a bit but i need the info about the Poly Lines.
My Binfile contains the Point Cloud, the Contours and the Slices.
Anyone here who could help me?
Thanks a lot in advance.
daniel
Site Admin
Posts: 7721
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CC *.bin file Content

Post by daniel »

This message is quite old and the BIN format has changed a lot since then.

It's now a serialized format where all data are stored almost as they are represented in memory. The data actually saved in the file varies from entity to entity. And it uses the internal hierarchy to share as most code as possible between entities. Today it's almost impossible to decipher it without (at least) the qCC_db library.

You can see for instance how a single cloud is saved:
https://github.com/cloudcompare/trunk/b ... .cpp#L3536

Silly question: can't you save the polylines to a different format first? (.poly or .shp for instance)
Daniel, CloudCompare admin
kave
Posts: 2
Joined: Tue Nov 29, 2016 8:56 pm

Re: CC *.bin file Content

Post by kave »

Hi Daniel,
I really like the simplicity of the animation tool in CC, and I'd like to use it to render some simulations of different perspectives from different modeled rigs. What I'd like to be able to do is simply write my own BIN file containing multiple viewports that could be opened in CC and then moved directly to the animation module--a little like a script file for the camera. I started looking in the ccPointCloud.cpp but didn't not see much mention of what is included in a saved Viewport(s). Any advice? Thanks!
daniel
Site Admin
Posts: 7721
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CC *.bin file Content

Post by daniel »

The BIN format is quite complicated, as it's a serialization of CloudCompare's objects (just as they are in memory). The only way to create a BIN file is therefore to use both the qCC_db and qCC_io libraries.

Maybe we should use a simple ASCII file for instance to describe the viewport positions (I think Meshlab has a quite simple open format for this: MLP).
Daniel, CloudCompare admin
kave
Posts: 2
Joined: Tue Nov 29, 2016 8:56 pm

Re: CC *.bin file Content

Post by kave »

OK, I see. Yep I'm familiar with MLP format. Ideally, one would Have the ability to control camera poses, lens and aspect parameters, and maybe even point weights and clipping planes. That would be a great addition to a really helpful animation package, and I would be a willing tester if you ever decide to implement something like that ;)
daniel
Site Admin
Posts: 7721
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: CC *.bin file Content

Post by daniel »

I already wanted to integrate the MLP format for a long time now (I'm just missing the time).

For the other options, it would be great of course, but we'll have to find some active support for this ;)
Daniel, CloudCompare admin
Post Reply