我有一组3D数据点,看起来像球体。我需要将这些数据点连接为防水网格,以便用于模拟
我与Meshlab合作,获得了合理的网格,但不防水
在此之后,我尝试了使用ball pivot算法使用Open3D python库。由此,我无法获得预期的防水网。我试图使用hole_fixer外部库(Hole_fixer),但在使用cmake安装时发现了错误
我已经插入了用于open3D的代码和“xyz”数据点
import numpy as np
import open3d as o3d
dataname = 'meshdata2.xyz'
point_cloud = np.loadtxt(dataname, skiprows=1)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(point_cloud[:,:3])
pcd.estimate_normals()
distances = pcd.compute_nearest_neighbor_distance()
avg_dist = np.mean(distances)
radius = 5*avg_dist
bpa_mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_ball_pivoting(pcd, o3d.utility.DoubleVector([radius, radius*2, radius*0.5]))
print(str(bpa_mesh.is_watertight()))
o3d.visualization.draw_geometries([bpa_mesh])
“xyz文件”的链接:xyz_file_link
从Open3D获取的网格:Mesh_from_open3D
我想知道如何获得这些数据点的防水网
任何线索将不胜感激
问候,
Sunag R A
要实现防水网格,可以使用
o3d.geometry.TriangleMesh.create_from_point_cloud_poisson
然而,泊松重建需要一致的法线方向。在本例中,您可以将所有法线朝向点云的中心。为此:
使用上述代码段获得的网格:
对于具有复杂拓扑的点云,可能不容易获得一致的法线方向,有关详细信息,请阅读my other answer
相关问题 更多 >
编程相关推荐