直接用octree当然不行,如果只是需要简单的反向后续在进行缩放或其他操作改变吧,顺便发一下octree的原理,便于理解它的操作流程,来自David Rutten——
Octrees work as follows:
A single box is created to contain all points. It can either be a tight bounding box or a cube.
If the box contains more than G points then then box is subdivided into 8 smaller boxes, each exactly 1/8 of the volume.
For each new box, repeat step 2.
所以如果用代码仿造这个思路,反向的思路大概是如果分割的box里的点小于某个值(当然需要设置下限)就继续分割。