Store the xys points into an octree. Args: points: (*, 3) max_depth: max depth of the octree. As the tree depth increases, internal (and eventually leaf) nodes represents a smaller partition of 3D space. Returns: an o3d octre
(
points: T.Union[torch.Tensor, np.ndarray, o3d.geometry.PointCloud],
max_depth: int = 5,
remove_nan_inf: bool = True,
)
| 228 | |
| 229 | |
| 230 | def create_octree( |
| 231 | points: T.Union[torch.Tensor, np.ndarray, o3d.geometry.PointCloud], |
| 232 | max_depth: int = 5, |
| 233 | remove_nan_inf: bool = True, |
| 234 | ) -> o3d.geometry.Octree: |
| 235 | """ |
| 236 | Store the xys points into an octree. |
| 237 | |
| 238 | Args: |
| 239 | points: |
| 240 | (*, 3) |
| 241 | max_depth: |
| 242 | max depth of the octree. As the tree depth increases, |
| 243 | internal (and eventually leaf) nodes represents a smaller partition of 3D space. |
| 244 | |
| 245 | Returns: |
| 246 | an o3d octree |
| 247 | """ |
| 248 | if isinstance(points, o3d.geometry.PointCloud): |
| 249 | pcd = points |
| 250 | elif isinstance(points, (torch.Tensor, np.ndarray)): |
| 251 | pcd = create_pcd( |
| 252 | points=points, |
| 253 | colors=None, |
| 254 | remove_nan_inf=remove_nan_inf, |
| 255 | ) |
| 256 | else: |
| 257 | raise NotImplementedError |
| 258 | |
| 259 | octree = o3d.geometry.Octree(max_depth=max_depth) |
| 260 | octree.convert_from_point_cloud( |
| 261 | point_cloud=pcd, |
| 262 | ) |
| 263 | return octree |
| 264 | |
| 265 | |
| 266 | def ray_aabb_intersection( |
nothing calls this directly
no test coverage detected