Open3D
Open3D copied to clipboard
How to save a octree to a file using open3d.io.write_octree?
Checklist
- [X] I have searched for similar issues.
- [X] For Python issues, I have tested with the latest development wheel.
- [X] I have checked the release documentation and the latest documentation (for
masterbranch).
My Question
I tried to save an octree in a file with open3d.io.write_octree.
import open3d as o3d import numpy as np from open3d.web_visualizer import draw from numpy import savetxt
if name == "main": N = 2000 armadillo_data = o3d.data.ArmadilloMesh() pcd = o3d.io.read_triangle_mesh( armadillo_data.path).sample_points_poisson_disk(N) # Fit to unit cube. pcd.scale(1 / np.max(pcd.get_max_bound() - pcd.get_min_bound()), center=pcd.get_center()) pcd.colors = o3d.utility.Vector3dVector(np.random.uniform(0, 1, size=(N, 3))) print('Displaying input pointcloud ...') #draw([pcd])
octree = o3d.geometry.Octree(max_depth=4)
octree.convert_from_point_cloud(pcd, size_expand=0.01)
print('Displaying octree ..')
#draw([octree])
o3d.io.write_point_cloud("copy_of_fragment.pcd", pcd)
o3d.io.write_octree("octofile.oct", octree)
But this does not work, write_point_cloud works fine but write_octree does not.
Anyone used this function ? Is there something that I am missing here ?