Closed mserouar closed 3 years ago
Hola! Thanks for the question.
There is already a scalar field that contains that information. You would need to first add a voxelgrid:
voxelgrid_id = could.add_structure("voxelgrid", n_x=64, n_y=64, n_z=64)
And then add the scalar field voxel_n
:
cloud.add_scalar_field("voxel_n", voxelgrid_id=voxelgrid_id)
This will add a new column to the points dataframe (in addition to the x, y, z) containing the unique voxel id for each point. You can then save the information to a file in the format you want.
Feel free to re-open if you consider that the question has not been properly answered
Just a quick thing, actually I'm more interested in linking voxels centers coordinates (in grids) with voxel class and then join with original point cloud. Is there a way to do it ?
Hello,
I don't know if it exists yet, but why not extracting in a file the xyz position of each points and their linked voxel. To know which points contain a voxel. Maybe in add_structure.
Congrats