Request to customize origin and size in octree.convert_from_point_cloud()
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
mainbranch).
Proposed new feature or change
Hi, I found that octree.convert_from_point_cloud() will adaptively adjust the origin and size of the octree based on the input pointcloud even if they are set when the octree was initialized.
Is it possible for this function to take two extra optional arguments origin and size so that they can be fixed?
References
No response
Additional information
No response
From a coding perspective, it would be possible and not very hard to add. But I cannot decide if that is wanted (gotta wait for some maintainer to decide).
Alternatively, you could use the constructor:
o3d.geometry.Octree.__init__(self, max_depth, origin, size)
Followed by looping over every point in the point cloud and insert it using:
o3d.geometry.Octree.insert_point(self, point, f_init, f_update, fi_init, fi_update)
The documentation for insert_point is not very helpful, but the following classes have static methods, which should be used to get the callbacks:
o3d.geometry.OctreePointColorLeafNode
o3d.geometry.OctreeInternalPointNode
octree.convert_from_point_cloud() does basically the same, looping over all points and inserting them:
https://github.com/isl-org/Open3D/blob/f02e7d24ea115e716445a7fae5093bce60a37d20/cpp/open3d/geometry/Octree.cpp#L544-L575
Currently, for the custom origin and size, this usage could be referenced.
https://github.com/isl-org/Open3D/blob/babbd7a016c350db4c9ebcfc911c7744b8c0c5d9/cpp/tests/geometry/Octree.cpp#L166-L173