Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Request to customize origin and size in octree.convert_from_point_cloud()

Open dunbar12138 opened this issue 1 year ago • 2 comments

Checklist

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

dunbar12138 avatar Jul 26 '24 06:07 dunbar12138

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

timohl avatar Jul 31 '24 10:07 timohl

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

chunibyo-wly avatar Jun 02 '25 01:06 chunibyo-wly