CloudCompare / CloudComPy

Python wrapper for CloudCompare
Other
283 stars 40 forks source link

From float64 cloud to float32 #118

Closed LFaggi closed 1 year ago

LFaggi commented 1 year ago

Hi,

first of all, thank you very much for the helpful repository. I am experiencing a seemingly rather simple issue. When opening a .ply cloud in double precision, and saving it immediately afterwards, I get that the output cloud is in standard precision.

cloud = cc.loadPointCloud(pc_path)
cc.SavePointCloud(cloud, pc_path)

Is there any way to maintain precision? Trying to print cc.getScalarType() I get "float32", but I haven't found how to change the corresponding setting to "float64". Sorry if this is a trivial question.

Regards, Lapo

LFaggi commented 1 year ago

Hi,

I think it was my mistake. It was due to my original point cloud, that although its vertices were saved as double type in the file header, they were actually floats.

Thank you, Lapo

prascle commented 1 year ago

Hi,

I build CloudComPy/CloudCompare with a Scalar field of type float (32 bits), but it is possible to build a version with a scalar field of type double (64 bits). Please let me know if a 64bit scalar field version is useful, nobody as asked yet. By the way: in CloudCompare, the point coordinates type is always set to float32, I have never tried to change that.

Regards, Paul

xiangtaoxu commented 1 year ago

That will be helpful! I sometimes need to assign some big integer numbers to scalar field. I have not encountered any problems with float32 yet but it might be useful to have higher resolution

Xiangtao

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Paul RASCLE @.> Sent: Sunday, July 2, 2023 11:47:26 AM To: CloudCompare/CloudComPy @.> Cc: Subscribed @.***> Subject: Re: [CloudCompare/CloudComPy] From float64 cloud to float32 (Issue #118)

Hi,

I build CloudComPy/CloudCompare with a Scalar field of type float (32 bits), but it is possible to build a version with a scalar field of type double (64 bits). Please let me know if a 64bit scalar field version is useful, nobody as asked yet. By the way: in CloudCompare, the point coordinates type is always set to float32, I have never tried to change that.

Regards, Paul

— Reply to this email directly, view it on GitHubhttps://github.com/CloudCompare/CloudComPy/issues/118#issuecomment-1616708427, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAVG3L24GYE4ZGCXHAK6J6DXOGJY5ANCNFSM6AAAAAAZ2XOLEI. You are receiving this because you are subscribed to this thread.Message ID: @.***>