point-e icon indicating copy to clipboard operation
point-e copied to clipboard

Save Point Cloud (not mesh)

Open dancergraham opened this issue 3 years ago • 4 comments

Hello,

It would be very nice to be able to save the point cloud (not the ply mesh) for visualisation in Cloud Compare / Blender / Excel / another viewer. Maybe a simple xyz file format would be best as that is very generic, human readable and should be accepted by almost all visualisation tools. The pointclouds are not large so a compressed file format like e57 is not needed.

I think some data is lost when exporting to a ply mesh so that does not solve the issue.

dancergraham avatar Dec 26 '22 08:12 dancergraham

I think it would make sense to implement this as a write_txt() method on the PointCloud object for consistency with write_ply.

A minimal working example would be

import numpy as np
rgb_scale = 255
xyz = np.concatenate([pc.coords, 
                      rgb_scale * np.array([pc.channels["R"], 
                                            pc.channels["G"], 
                                            pc.channels["B"]
                                           ]
                                          ).T
                     ], axis=1)
np.savetxt("pts.xyz", xyz)

dancergraham avatar Dec 26 '22 14:12 dancergraham

Results for the cubes example visualised in Cloud Compare:

image

dancergraham avatar Dec 26 '22 14:12 dancergraham

how to get the same rendering result as the paper?

ImneCurline avatar May 03 '23 09:05 ImneCurline

If you open them in Cloud Compare, set the background color to white and increase the point size and experiment with the view settings then you should be able to get something similar

dancergraham avatar May 03 '23 09:05 dancergraham