Hi, thanks for building this cool tool. I am learning to use it.
I found that there was always an extra voxel after building the Octree from a point cloud. I've tried several meshes, and they all have extra points. I also noticed that the extra point always had one zero in its coordinate.
Below is the code:
path_ply = 'mesh_gt/buddha.ply'
mesh = trimesh.load(path_ply)
vertices = torch.tensor(mesh.vertices, dtype=torch.float32)
center = vertices.mean(0)
vertices -= center
scale = vertices.abs().max()
vertices /= scale
pts_oct = Points(vertices)
octree = Octree(7, 4)
octree.build_octree(pts_oct)
x, y, z, b = octree.xyzb(5, True)
voxels = torch.stack([x, y, z, b], dim=1)
You should strictly normalize the points into the range of [-1, 1]^3.
A good practice is to normalize it into [-0.99, 0.99]^3 or [0.9, 0.9]^3 to retain some margin.
Hi, thanks for building this cool tool. I am learning to use it.
I found that there was always an extra voxel after building the Octree from a point cloud. I've tried several meshes, and they all have extra points. I also noticed that the extra point always had one zero in its coordinate.
Below is the code: