Skip to content

Binary File Format Structure

mika edited this page Feb 14, 2020 · 31 revisions

Default custom .bin data aka V1 (not brekel format or CloudCompare .bin)

EXAMPLE

01 B5 E5 26 00 01 30 4C
2A 40 57 5B D9 3F 7D 3F
9D 3F 00 00 80 3F 00 00
80 3F 00 00 80 3F AA 82
69 40 DC 46 13 40 1E A7
C8 3F FC FB 7B 3F F8 F7

HEADER 5 bytes

  • byte version (0 or 1 for normal point cloud data, 0 is the original first version, use 1 for now)
  • int32 totalPoints (total amount of points in this file
  • bool containsRGB (true or false, if RGB data is included

DATA

  • float x
  • float y
  • float z
  • float R (optional)
  • float G (optional)
  • float B (optional)
  • (repeat for all points)

Custom (v2) .ucpc binary format

EXAMPLE

75 63 70 63 02 01 61 e4
20 00 e3 53 b9 c0 78 b7
d2 bd 67 66 14 c1 4f 58
bd 40 7e 00 82 3e 38 be
03 41 a7 22 b6 c0 8d 62
13 d0 0e 3f 94 08 f1 e4

unitycoder-binary-v2-header

HEADER 34 Bytes

  • string magic_string : 4 bytes : value = "ucpc"
  • bool binary_version : 1 byte (should be set to 2)
  • bool contains_rgb : 1 byte (should be set to true and must include color data)
  • int pointcount : 4 bytes
  • float bounds_min_x : 4 bytes
  • float bounds_min_y : 4 bytes
  • float bounds_min_z : 4 bytes
  • float bounds_max_x : 4 bytes
  • float bounds_max_y : 4 bytes
  • float bounds_max_z : 4 bytes

DATA

  • float x
  • float y
  • float z (rest of the XYZ values one by one)
  • float R (optional)
  • float G (optional)
  • float B (optional) (rest of the RGB values one by one)

Custom (v3) tiles .pcroot (and .pct, .rgb)

.pcroot is ascii, |-character separated index file, containing list of point cloud tiles

HEADER

1|4|2155617|-28.617|-0.514445|-1.03455|29.9256|1.26955|86.51015|0.680891|90.6809|0|2
1 = version
4 = grid size
2155617 = total point count
-28.617 = cloud boundsMinX
-0.514445 = cloud boundsMinY
-1.03455 = cloud boundsMinZ
29.9256 = cloud boundsMaxX
1.26955 = cloud boundsMaxY
86.51015 = cloud boundsMaxZ
0.680891 = auto-offset X
90.6809 = auto-offset Y
0 = auto-offset Z
2 = packMagic value (optional)

DATA

sample3201.pct|13376|-3.999089|0.3418615|4.25345|3.999676|0.78206|7.97845
sample3201.pct = filename
13376 = tile point count
-3.999089 = tile boundsMinX
0.3418615 = tile boundsMinY
4.25345 = tile boundsMinZ
3.999676 = tile boundsMaxX
0.78206 = tile boundsMaxY
7.97845 = tile boundsMaxZ


BREKEL OUTPUT .BIN FORMAT

HEADER

  • byte version (2 for brekel data)
  • int32 numberOfFrames (how many frames of data)
  • int32 frameRate (not used)
  • bool containsRGB (true or false, if RGB data is included)
  • int32[] pointsPerFrame (array of how many points for each frame)
  • int64[] binaryPositionForEachFrame (array of indexes to each frame data position in file)

DATA

  • float x
  • float y
  • float z
  • float R (optional)
  • float G (optional)
  • float B (optional)
  • (repeat for all points for each frame)

TOOLS