Difference between revisions of "SBF"

From CloudCompareWiki
Jump to navigation Jump to search
(Created page with "=Introduction= The SBF (Simple Binary File) format, is meant to ease the export and external processing of big point clouds. While the BIN format of CloudCompare can store a...")
 
Line 3: Line 3:
 
The SBF (Simple Binary File) format, is meant to ease the export and external processing of big point clouds.
 
The SBF (Simple Binary File) format, is meant to ease the export and external processing of big point clouds.
  
While the BIN format of CloudCompare can store about anything created or loaded in CloudCompare, it is complex to decode (as it is a serialized stream of what is loaded in the memory - '''the only way to properly open a BIN file is to use QCC_DB_LIB''').
+
While the BIN format of CloudCompare can store about anything created or loaded in CloudCompare, it is highly complex to decode (as it is a serialized stream of what is loaded in the memory - '''the only way to properly open a BIN file is to use QCC_DB_LIB''').
  
Thus, the SBF format has been created to store data in a Binary file with a very simple structure, and to store some more meta-data in a text file next to the binary file.
+
Thus, the SBF format has been created to store 3D points and scalar field values in a binary file with a very simple structure (+ some more meta-data in a text file next to the binary file).
 +
 
 +
The file structure is always like this:
 +
- myfile.sbf (text file with meta-data)
 +
- myfile.data.sbf (binary file)
  
 
=Specifications=
 
=Specifications=
  
 
==Binary file==
 
==Binary file==
 +
This section describes the contents of the binary file (.data.sbf)
  
 
=== Header ===
 
=== Header ===
Line 50: Line 55:
  
 
=== Body ===
 
=== Body ===
All values are saved with 32bit floating point precision (= 'float').
 
 
 
For each point (1-Np):
 
For each point (1-Np):
 
{| cellpadding="10" style="text-align:center; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"  
 
{| cellpadding="10" style="text-align:center; border-collapse: collapse; border-width: 1px; border-style: solid; border-color: #000"  

Revision as of 04:49, 9 February 2020

Introduction

The SBF (Simple Binary File) format, is meant to ease the export and external processing of big point clouds.

While the BIN format of CloudCompare can store about anything created or loaded in CloudCompare, it is highly complex to decode (as it is a serialized stream of what is loaded in the memory - the only way to properly open a BIN file is to use QCC_DB_LIB).

Thus, the SBF format has been created to store 3D points and scalar field values in a binary file with a very simple structure (+ some more meta-data in a text file next to the binary file).

The file structure is always like this:

- myfile.sbf (text file with meta-data)
- myfile.data.sbf (binary file)

Specifications

Binary file

This section describes the contents of the binary file (.data.sbf)

Header

Total length: 64 bytes

Bytes Description Value / comment
0-1 SBF header flag 42 42
2-9 Point count (Np) 8 bytes unsigned integer
10-11 Scalar field count (Ns) 2 bytes unsigned integer
12-19 X coordinate shift (should be added to all 32bit coordinates stored in the file) 64bit floating point value ('double')
20-27 Y coordinate shift (should be added to all 32bit coordinates stored in the file) 64bit floating point value ('double')
28-35 Z coordinate shift (should be added to all 32bit coordinates stored in the file) 64bit floating point value ('double')
36-63 Reserved for later 0

Body

For each point (1-Np):

Bytes Description Value / comment
0-3 X coordinate 32bit floating point value ('float')
4-7 Y coordinate 32bit floating point value ('float')
8-11 Z coordinate 32bit floating point value ('float')
12-15 Scalar value (SF #1) 32bit floating point value ('float')
16-19 Scalar value (SF #2) 32bit floating point value ('float')
... ...
12-15 + k * 4 (k in [0 ; Ns[) Scalar value (SF #k) 32bit floating point value ('float')