Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named argument "width" not accepted by create_box in tensor API #7135

Open
3 tasks done
joseph-sch opened this issue Jan 13, 2025 · 0 comments · May be fixed by #7136
Open
3 tasks done

Named argument "width" not accepted by create_box in tensor API #7135

joseph-sch opened this issue Jan 13, 2025 · 0 comments · May be fixed by #7136
Labels
bug Not a build issue, this is likely a bug.

Comments

@joseph-sch
Copy link

Checklist

Describe the issue

The equivalent of the o3d.geometry.TriangleMesh.create_box() method in the tensor API is o3d.geometry.TriangleMesh.create_box(). Contrary to the legacy API, the tensor API does not accept the named argument "width".

This is due to a MISSING COMMA between the end of the method documentation and the first argument:

.def_static("create_box", &TriangleMesh::CreateBox,
"Create a box triangle mesh. One vertex of the box"
"will be placed at the origin and the box aligns"
"with the positive x, y, and z axes."
"width"_a = 1.0,
"height"_a = 1.0, "depth"_a = 1.0,
"float_dtype"_a = core::Float32,
"int_dtype"_a = core::Int64,
"device"_a = core::Device("CPU:0"))

(Notice also that spaces should be present on each line of the documentation before the closing quotation marks.)

Steps to reproduce the bug

import open3d as o3d

m = o3d.t.geometry.TriangleMesh.create_box(5, 4, 3)  # works
m = o3d.t.geometry.TriangleMesh.create_box(width=5, depth=4, height=3)  # doesn't work

Error message

Traceback (most recent call last):
  File "<string>", line 1, in <module>
TypeError: create_box(): incompatible function arguments. The following argument types are supported:
    1. (Create a box triangle mesh. One vertex of the boxwill be placed at the origin and the box alignswith the positive x, y, and z axes.width: float = 1.0, height: float = 1.0, depth: float = 1.0, float_dtype: open3d.cpu.pybind.core.Dtype = Float32, int_dtype: open3d.cpu.pybind.core.Dtype = Int64, device: open3d.cpu.pybind.core.Device = CPU:0) -> open3d.cpu.pybind.t.geometry.TriangleMesh

Invoked with: kwargs: width=5, height=4, depth=3

Expected behavior

The o3d.t.geometry.TriangleMesh.create_box should accept the width named argument.

Open3D, Python and System information

- Python version: Python 3.11, Python 3.12
- Open3D version: 0.18.0, 0.19.0

Additional information

No response

@joseph-sch joseph-sch added the bug Not a build issue, this is likely a bug. label Jan 13, 2025
joseph-sch added a commit to joseph-sch/Open3D that referenced this issue Jan 13, 2025
 * Add the missing comma before the first argument's name
 * Add the missing spaces in the function description
@joseph-sch joseph-sch linked a pull request Jan 13, 2025 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not a build issue, this is likely a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant