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

Minimal oriented bounding box is not minimal #6866

Closed
3 tasks done
belalhmedan90 opened this issue Jul 12, 2024 · 1 comment · Fixed by #6898
Closed
3 tasks done

Minimal oriented bounding box is not minimal #6866

belalhmedan90 opened this issue Jul 12, 2024 · 1 comment · Fixed by #6898
Labels
bug Not a build issue, this is likely a bug.

Comments

@belalhmedan90
Copy link

Checklist

Describe the issue

I get non-minmal bounding box when calling get_minimal_oriented_bounding_box

minimal_obbox

Steps to reproduce the bug

import open3d as o3d

box_pcl = o3d.io.read_point_cloud(os.path.join(test_data_path, "pcl.ply"))

box_mesh = o3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape(
    pcd=box_pcl, alpha=1.0
)

obbox = box_pcl.get_minimal_oriented_bounding_box(robust=True)
obbox.color = [0.5, 0.2, 0.7]

obbox2 = box_mesh.get_minimal_oriented_bounding_box(robust=True)
obbox2.color = [0.5, 0.7, 0.2]
## Visu
o3d.visualization.draw_geometries(
    [box_mesh, obbox, obbox2],
    window_name="minimal_obbox",
    point_show_normal=False,
    mesh_show_wireframe=False,
    mesh_show_back_face=False,
)

Error message

No response

Expected behavior

To get minimal Oriented Bounding Box

Open3D, Python and System information

- Operating system: Ubuntu 20.04
- Python version: Python 3.8
- Open3D version: 0.18.0
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): gcc 7.5

Additional information

No response

@belalhmedan90 belalhmedan90 added the bug Not a build issue, this is likely a bug. label Jul 12, 2024
@nicolaloi
Copy link
Contributor

nicolaloi commented Jul 15, 2024

I have reproduced the error, which is probably caused by MeshBase::GetMinimalOrientedBoundingBox having the same body as MeshBase::GetOrientedBoundingBox, instead of being similar to PointCloud::GetMinimalOrientedBoundingBox.

I'll open a PR.

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
2 participants