Page 1 of 1

Display .pcd files by adding bounding box to header?

Posted: Wed Jun 18, 2025 8:43 am
by hanham
Hi!

I would like to display .pcd files in CloudCompare, however, they don't show up in the GUI as I get the following error:

"[ccGLWindow] Entity/DB has a null bounding-box! Can't zoom in..."

So, the question here is, is it possible to add a bounding box to my .pcd file, and if so, how? if it is possible to add it manually to the header file, what format should it be on? Or is there another way that will enable me to display the .pcd files in CC?

I'm using version 2.11.1 (Anoia) [Linux 64-bit] compiled with Qt 5.9.5 and this is an example pcd file header:

This is an example of a .pcd file header:

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 8 8 8
TYPE F F F
COUNT 1 1 1
WIDTH 41459
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 41459
BBOX
DATA binary

Thanks in advance.

Re: Display .pcd files by adding bounding box to header?

Posted: Sat Jun 21, 2025 8:35 am
by daniel
The error might be misleading, but in fact it just says that all the points are at the same position (or there's no point in the cloud). This prevents CC from zooming properly on the entity (= point).

Are these PCD files containing only one point maybe?

Re: Display .pcd files by adding bounding box to header?

Posted: Mon Jun 23, 2025 5:38 pm
by hanham
The coordinates are not the same if I look in the .pcd files and there are about 400 k points in each file, but perhaps something happens inside of CC that makes it seem to CC as if there is only one point or that they are in the same spot?

Here is a minimal working python example to recreate the issue:

import open3d as o3d
import numpy as np

pcd = o3d.t.geometry.PointCloud()
points = np.random.rand(100, 3)
pcd = o3d.t.geometry.PointCloud()
pcd.point.positions = o3d.core.Tensor(points)
o3d.t.io.write_point_cloud('test.pcd',pcd,write_ascii=True)

If I now open 'test.pcd' with CC, the box dimensions are X: 0, Y: 0, and Z:0 and none of the points show up.

Re: Display .pcd files by adding bounding box to header?

Posted: Tue Jun 24, 2025 9:03 pm
by daniel
Can you share an example file with me? (admin@cloudcompare.org)

Re: Display .pcd files by adding bounding box to header?

Posted: Thu Aug 21, 2025 11:40 am
by hanham
Absolutely, try pasting the pcd below into a file and name it e.g. "test.pcd" and then open it in CC. At least for me, no points are visible in CC.

# .PCD v0.7 - Point Cloud Data file format
VERSION 0.7
FIELDS x y z
SIZE 8 8 8
TYPE F F F
COUNT 1 1 1
WIDTH 100
HEIGHT 1
VIEWPOINT 0 0 0 1 0 0 0
POINTS 100
DATA ascii
0.04211831953 0.08573125759 0.1258946899
0.04947003002 0.6064357281 0.6523669977
0.5433628333 0.7376074272 0.774230354
0.7624140836 0.2113466392 0.4575169809
0.3817580797 0.3473703188 0.8921163277
0.462062901 0.5173365856 0.3346969826
0.1380427418 0.9144111464 0.3483638511
0.4028143813 0.5575800732 0.4503262763
0.9427992201 0.3657204301 0.4341218884
0.6739308728 0.01957996542 0.4692848223
0.1415832173 0.2323473804 0.03012367557
0.7812440791 0.4604892631 0.493912355
0.07296361677 0.7351982431 0.5658746488
0.5921772826 0.2714910701 0.002393429067
0.6645374854 0.8588753666 0.8564471818
0.9789325589 0.4019076185 0.1735452595
0.2582825995 0.9268661874 0.2164972129
0.5057936271 0.8871984779 0.7081169437
0.07583889734 0.9699402324 0.1494992798
0.5611203204 0.5321309838 0.8659852388
0.5971745932 0.4174372355 0.754554609
0.9115041905 0.8126787465 0.4746492233
0.8013587196 0.9047614347 0.01910770154
0.7397209095 0.7138222175 0.8340675031
0.883947576 0.9993371297 0.7039834587
0.8720776345 0.9789683304 0.6346826893
0.9608761686 0.2949861769 0.2667671918
0.1224584771 0.161164411 0.7032855405
0.674784363 0.6399023536 0.5118660889
0.02238814628 0.4546009551 0.001906596615
0.801765352 0.4734036987 0.553655602
0.4025930257 0.0123510025 0.6168342498
0.1279172519 0.9015497263 0.2631652973
0.4249094203 0.2143798145 0.9679398102
0.2477796736 0.4174865181 0.06235843442
0.4356509352 0.7994176128 0.5197531379
0.3060486798 0.6832583577 0.843636285
0.1210014292 0.9324351356 0.2492007622
0.665444153 0.9920610784 0.3684508866
0.7413676246 0.7345201543 0.4512789307
0.9752953588 0.1870560922 0.3788979249
0.7216647425 0.3093773801 0.5669446737
0.5784163687 0.9696304553 0.8581953954
0.1175498156 0.7291133231 0.73024803
0.2156348882 0.7040796516 0.7152864771
0.1148135531 0.8413866402 0.1892278656
0.4303496111 0.4837981768 0.04628797091
0.3192968555 0.7135295516 0.7992114007
0.006420893536 0.9353394365 0.3336965501
0.08575513367 0.5913465065 0.2507453921
0.1296186348 0.416284434 0.3437363209
0.9674638127 0.2776432882 0.2137082782
0.4473380648 0.6332356031 0.4527147497
0.6470821047 0.8891598317 0.6458984937
0.834500868 0.7009669518 0.04676329842
0.8542343674 0.8739401881 0.460827284
0.4592786763 0.8376176266 0.4817652198
0.2598531276 0.3175091712 0.5171172667
0.8819496646 0.7859712776 0.3057465715
0.9574048227 0.3153008643 0.7390961212
0.3179575795 0.4289789625 0.8281998027
0.8614477289 0.4112882719 0.8130834893
0.2050566919 0.7747624302 0.06603170959
0.3553103028 0.7541856213 0.1150161684
0.09623752499 0.8637876343 0.5597247715
0.9503024667 0.2551820924 0.937148138
0.6648691321 0.1994202216 0.5738280701
0.4289935155 0.8802453578 0.9232027018
0.9777648973 0.7741441079 0.9761191953
0.6202736127 0.5371813651 0.9416295902
0.3816490403 0.7245509539 0.9240006311
0.2944268994 0.4729777029 0.5090848677
0.3208630939 0.2883970581 0.2486317718
0.9932477512 0.4482572326 0.7840505509
0.04188988505 0.3489478512 0.1576655599
0.8858324915 0.05935259456 0.721109606
0.8584048778 0.1704769569 0.6274293239
0.8790780455 0.3747712347 0.8932295972
0.1521075157 0.8298663541 0.7126951679
0.541204819 0.5690152285 0.5418126701
0.0234654785 0.3659044894 0.7150359482
0.4815933095 0.9211238815 0.4992829335
0.8846022714 0.1537252101 0.708385442
0.2163669051 0.5137760504 0.4029658965
0.9846636553 0.4638877376 0.9818204975
0.3823999523 0.4071480643 0.3631441472
0.4030187753 0.0562383511 0.2983542525
0.6138095747 0.3832975691 0.5666898526
0.9185110493 0.7211542641 0.06849661923
0.940424725 0.8534520614 0.2324825645
0.2826569474 0.07889365974 0.01629346093
0.865154188 0.1653444483 0.2326037532
0.5505766414 0.215305086 0.4897354882
0.4865277019 0.7870199406 0.3920895188
0.9443900829 0.3954114941 0.8279062594
0.2486001179 0.3429748808 0.3059928487
0.3459508525 0.8745632913 0.953930099
0.8028265803 0.8325387833 0.6045224734
0.6221274374 0.9784327666 0.8298950112
0.7581207312 0.8840004254 0.9320872613

Re: Display .pcd files by adding bounding box to header?

Posted: Thu Aug 21, 2025 1:27 pm
by hanham
I believe I found the answer to the error. It seems that CC cannot open .pcd files where the points are saved as 'float64'.

This will not be visible in CC:

import open3d as o3d

pcd = o3d.t.geometry.PointCloud()
points = np.random.rand(100, 3).astype('float64') # (float64 is the default dtype)
pcd = o3d.t.geometry.PointCloud()
pcd.point.positions = o3d.core.Tensor(points)
o3d.t.io.write_point_cloud('test1.pcd',pcd,write_ascii=False)

This will be visible in CC:

pcd = o3d.t.geometry.PointCloud()
points = np.random.rand(100, 3).astype('float32')
pcd = o3d.t.geometry.PointCloud()
pcd.point.positions = o3d.core.Tensor(points)
o3d.t.io.write_point_cloud('test1.pcd',pcd,write_ascii=False)

Re: Display .pcd files by adding bounding box to header?

Posted: Sun Aug 24, 2025 8:36 am
by daniel
Then I guess the issue only arise when you save the cloud as binary? Because in your example above, as ASCII, the points are not saved as 64bits float, and the file can be loaded in CC without any problem.

Do you have a 64bits example for me to see what can be done in CC?