我想在使用 Python 可视化 open3D 中的点云时显示坐标。根据文档,我编写了以下代码,其中第三行应该创建一个坐标。(假设point_cache
是一个np.array
带形状的(442368, 3)
)
pcd = o3d.geometry.PointCloud()
pcd.points = o3d.utility.Vector3dVector(point_cache)
mesh_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=0.6, origin=[-2, -2, -2])
o3d.visualization.draw_geometries([pcd, mesh_frame])
但是它显示了以下错误,表明没有调用create_coordinate_frame
in的属性TriangleMesh
。
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-20-2e528bfc7404> in <module>
1 pcd = o3d.geometry.PointCloud()
2 pcd.points = o3d.utility.Vector3dVector(point_cache)
----> 3 mesh_frame = o3d.geometry.TriangleMesh.create_coordinate_frame(size=0.6, origin=[-2, -2, -2])
4 o3d.visualization.draw_geometries([pcd, mesh_frame])
AttributeError: type object 'open3d.open3d.geometry.TriangleMesh' has no attribute 'create_coordinate_frame'
我想知道为什么会出现此错误,因为第三行与文档相同。
我的open3D版本如下。
[Frost@CC’s Mac ~]$ python3 -m pip show open3d
Name: open3d
Version: 0.8.0.0
Summary: ['Open3D is an open-source library that supports rapid development of software that deals with 3D data.']
Home-page: http://www.open3d.org
Author: Open3D Team
Author-email: info@open3d.org
License: MIT
Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requires: notebook, widgetsnbextension, ipywidgets, numpy
Required-by: