Open3d: "TypeError: crop(): incompatible function arguments" in "examples/Python/Basic/half_edge_mesh.py"

Created on 14 Oct 2019  ·  3Comments  ·  Source: intel-isl/Open3D

Describe the bug
I couldn't run the example half_edge_mesh.py. After #1218 it always throws

RPly: Unable to open file
[Open3D WARNING] Read PLY failed: unable to open file: ../../TestData/sphere.ply
Traceback (most recent call last):
  File "examples/Python/Basic/half_edge_mesh.py", line 28, in <module>
    mesh = mesh.crop(bbox)
TypeError: crop(): incompatible function arguments. The following argument types are supported:
    1. (self: open3d.open3d.geometry.TriangleMesh, min_bound: numpy.ndarray[float64[3, 1]], max_bound: numpy.ndarray[float64[3, 1]]) -> open3d.open3d.geometry.TriangleMesh

Invoked with: geometry::TriangleMesh with 0 points and 0 triangles., geometry::AxisAlignedBoundingBox

And before #1218 (still at version 0.8.0) it throws

RPly: Unable to open file
[Open3D WARNING] Read PLY failed: unable to open file: ../../TestData/sphere.ply
Traceback (most recent call last):
  File "examples/Python/Basic/half_edge_mesh.py", line 26, in <module>
    het_mesh = o3d.geometry.HalfEdgeTriangleMesh.create_from_triangle_mesh(mesh)
AttributeError: type object 'open3d.open3d.geometry.HalfEdgeTriangleMesh' has no attribute 'create_from_triangle_mesh'

To Reproduce
Steps to reproduce the behavior:

  1. cd open3d
  2. python3 examples/Python/Basic/half_edge_mesh.py
  3. See error

Expected behavior
The example should work.

Environment (please complete the following information):

  • OS: OSX Mojave
  • Python version: 3.7
  • Open3D version: 0.8.0
  • Is this remote workstation?: no
  • How did you install Open3D?: conda

Additional context
I tried to move the example file half_edge_mesh.py to the same folder with TestData/sphere.ply and edit the path. The warning [Open3D WARNING] Read PLY failed: unable to open file: ../../TestData/sphere.ply is disappeared but the TypeError or AttributeError are still exist.

possible bug

Most helpful comment

Ok, got it. You are using the example code from the master branch that uses AxisAlignedBoundingBox, but the open3d source you are using seems to be older than the master branch (see method signature in your first output snippet).
Either you update open3d to the current master and compile it yourself, or you use the examples in the v0.8.0 branch (https://github.com/intel-isl/Open3D/tree/v0.8.0).

All 3 comments

I am not able to reproduce with the code from master. Are you running the script from within Open3D/examples/Python/Basic?

@griegler yes, I did, but the same error. Is there anything I could do to find more clues?

Ok, got it. You are using the example code from the master branch that uses AxisAlignedBoundingBox, but the open3d source you are using seems to be older than the master branch (see method signature in your first output snippet).
Either you update open3d to the current master and compile it yourself, or you use the examples in the v0.8.0 branch (https://github.com/intel-isl/Open3D/tree/v0.8.0).

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HaiyongJiang picture HaiyongJiang  ·  3Comments

DKandrew picture DKandrew  ·  4Comments

edxsx picture edxsx  ·  3Comments

nrj127 picture nrj127  ·  4Comments

Timu777 picture Timu777  ·  3Comments