当我尝试在 open3D 中分配三角形时出错



我正在尝试这样做:

mesh = o3d.geometry.TriangleMesh()
mesh.vertices=o3d.utility.Vector3dVector(vertices)
mesh.triangles=o3d.utility.Vector3dVector(triangles)

但是我得到了这个错误:

TypeError: (): incompatible function arguments. The following argument types are supported:
1. (self: open3d.open3d_pybind.geometry.TriangleMesh, arg0: open3d.open3d_pybind.utility.Vector3iVector) -> None
Invoked with: geometry::TriangleMesh with 3400 points and 0 triangles., std::vector with 6768 elements.
Use numpy.asarray() to access data.
Did you forget to #include ? Or ,
, , etc. Some automatic
conversions are optional and require extra headers to be included
when compiling your pybind11 module.
vertices is a numpy array with shape (3400,3)
and triangles is also a numpy array with shape (6768,3)

谢谢

解决方案是将这个mesh.triangles=o3d.utility.Vector3dVector(triangles(更改为mesh.triangles=o3d.utility.Vector3iVector(triangles(。

最新更新