将八叉树沿给定的平移向量平移。
def translate(self, translation: np.ndarray):
translation
: ndarray
几何树的平移向量。它是一个 3x1
的 numpy
数组。该函数没有返回值。
import open3d as o3d
import numpy as np
octree = o3d.geometry.Octree(max_depth=5)
points = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]])
octree.convert_from_point_cloud(o3d.geometry.PointCloud(points))
octree.translate(np.array([1.0, 2.0, 3.0]))
o3d.visualization.draw_geometries([octree])
上述示例将一个八叉树从原点向正方向平移 (1, 2, 3)
。