我正在尝试使用 open3d 在一组 3d 点周围创建一个“alphahull”,使用TriangleMesh
. 但是我得到一个类型错误。
import open3d as o3d
import numpy as np
xx =np.asarray([[10,21,18], [31,20,25], [36,20,24], [33,19,24], [22,25,13], [25,19,24], [22,26,10],[29,19,24]])
cloud = o3d.geometry.PointCloud()
cloud.points = o3d.utility.Vector3dVector(xx)
mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape(pcd=cloud, alpha=10.0)
输出:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: create_from_point_cloud_alpha_shape(): incompatible function arguments. The following argument types are supported:
1. (pcd: open3d.open3d.geometry.PointCloud, alpha: float, tetra_mesh: open3d::geometry::TetraMesh, pt_map: List[int]) -> open3d.open3d.geometry.TriangleMesh
该错误表明我传递函数的对象是错误的类型。但是当我检查类型时,我得到了这个:
>>print(type(cloud))
<class 'open3d.open3d.geometry.PointCloud'>
请问有人可以帮我解决这个错误吗?
注意:对这篇文章Python open3D no attribute 'create_coordinate_frame' 的评论表明它可能是安装问题,解决方案是从源代码编译库。所以我从源代码编译了这个库。这跑完之后
make install-pip-package
。虽然我不确定它是否正确完成,因为我还不能import open3d
在 python 中;查看安装输出:https ://pastebin.com/sS2TZfTL
(我不确定该命令是否应该完成安装,或者您是否仍需要运行 pip?运行后python3 -m pip install Open3d
我可以在 python 中导入库.)