Open3D icon indicating copy to clipboard operation
Open3D copied to clipboard

Adding minimum volume oriented bounding ellipsoid matching functionality

Open quentin-leboutet opened this issue 2 months ago • 1 comments

Add Oriented Bounding Ellipsoid (OBE) support to Open3D

Type

  • [ ] Bug fix (non-breaking change which fixes an issue): Fixes #
  • [x] New feature (non-breaking change which adds functionality). Resolves #
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

Motivation and Context

This PR adds support for Oriented Bounding Ellipsoids (OBE) to Open3D, complementing the existing bounding volume primitives (AABB and OBB). Oriented bounding ellipsoids provide a tighter fit for certain geometries compared to boxes, which can be beneficial for:

  • More accurate spatial representations of point clouds and meshes
  • Improved collision detection and computational geometry applications
  • Better geometric analysis and understanding of 3D shapes

The implementation uses Khachiyan's algorithm to compute the minimum volume enclosing ellipsoid, providing an efficient approximation of the optimal bounding ellipsoid.

Screenshot 2025-11-23 at 00 20 05 Screenshot 2025-11-23 at 00 21 54 Screenshot 2025-11-23 at 00 20 40

Checklist:

  • [ ] I have run python util/check_style.py --apply to apply Open3D code style to my code.
  • [x] This PR changes Open3D behavior or adds new functionality.
    • [x] Both C++ (Doxygen) and Python (Sphinx / Google style) documentation is updated accordingly.
    • [x] I have added or updated C++ and / or Python unit tests OR included test results (e.g. screenshots or numbers) here.
  • [x] I will follow up and update the code if CI fails.
  • [x] For fork PRs, I have selected Allow edits from maintainers.

Description

Core Implementation

New Classes:

Key Features:

  1. Minimum volume ellipsoid computation using Khachiyan's algorithm
  2. Geometry integration:
    • Added GetOrientedBoundingEllipsoid() method to all 3D geometry base classes (Geometry3D.h:74-75)
    • Support for PointCloud, TriangleMesh, LineSet, VoxelGrid, and Octree
  3. Ellipsoid mesh generation:
  4. Transformation operations:
  5. Visualization support:
  6. Python bindings:
    • Complete Python API through pybind11 (boundingvolume.cpp)
    • create_from_points() static method with robust option
    • Properties: center, R (rotation), radii, color

Try it:

import open3d as o3d
mesh = o3d.io.read_triangle_mesh("<your_mesh>.obj")
mesh.compute_triangle_normals()
ellipsoid = o3d.geometry.OrientedBoundingEllipsoid.create_from_points(o3d.utility.Vector3dVector(mesh.vertices))
print(f"Volume ellipsoid: {ellipsoid.volume()}")
ellipsoid.color = (0, 0.44313725490196076, 0.7725490196078432)
ellipsoid_lines = o3d.geometry.LineSet.create_from_oriented_bounding_ellipsoid(ellipsoid)
o3d.visualization.draw([mesh, ellipsoid_lines])

quentin-leboutet avatar Nov 23 '25 00:11 quentin-leboutet

Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.

update-docs[bot] avatar Nov 23 '25 00:11 update-docs[bot]