isl-org / isl-org/Open3D

How to save a octree to a file using open3d.io.write_octree?

Open
#5,695 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
C++
Stars
14k
Forks
2.6k
Avg merge
5d 18h
Merged PRs (30d)
6

Description

### Checklist

- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### 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 ?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.