0

我正在尝试这样做:

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)

谢谢

4

1 回答 1

1

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

于 2020-06-24T16:01:06.690 回答