该方法判断给定点是否在八叉树边界内。
is_point_in_bound(point: numpy.ndarray) -> bool:
point
: numpy.ndarray bool
import numpy as np
import open3d as o3d
points = np.array([[0.1, 0.2, 0.3], [0.4, 0.5, 0.6], [0.7, 0.8, 0.9]])
octree = o3d.geometry.Octree()
octree.convert_from_point_cloud(o3d.geometry.PointCloud(points))
bound = octree.get_bounding_box()
point_in = np.array([0.2, 0.4, 0.6])
point_out = np.array([0.8, 1.0, 1.2])
print(octree.is_point_in_bound(point_in)) # True
print(octree.is_point_in_bound(point_out)) # False
TypeError
point坐标类型错误。
ValueError
point坐标大小错误。