実際のところ
import open3d as o3d import numpy as np dataset = o3d.data.LivingRoomPointClouds() pcds = [] pcds.append(o3d.io.read_point_cloud('/root/open3d_data/extract/LivingRoomPointClouds/cloud_bin_1.ply')) ptCloud = pcds[0] ##近傍の点群をKD木で ptCloud.estimate_normals( search_param=o3d.geometry.KDTreeSearchParamHybrid(radius=0.1, max_nn=30)) # 点群のベクトル方向群を正規化する(点に方向はないので) ptCloud.orient_normals_consistent_tangent_plane(10) # "ball pivoting"法で表面を構築 distances = ptCloud.compute_nearest_neighbor_distance() avg_dist = np.mean(distances) radius = 2*avg_dist radii = [radius, radius * 2] recMeshBPA = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting( ptCloud, o3d.utility.DoubleVector(radii)) #描画 o3d.visualization.draw_plotly( [recMeshBPA], width=400, height=400 )