Open3D
Open3D copied to clipboard
Adding minimum volume oriented bounding ellipsoid matching functionality
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.
Checklist:
- [ ] I have run
python util/check_style.py --applyto 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:
- OrientedBoundingEllipsoid (legacy API)
- t::geometry::OrientedBoundingEllipsoid (tensor-based API)
Key Features:
- Minimum volume ellipsoid computation using Khachiyan's algorithm
- kernel implementation in cpp/open3d/t/geometry/kernel/MinimumOBE.cpp (tensor-based API)
- Computes convex hull first for optimal results
- Canonical orientation mapping for consistent representation
- Geometry integration:
- Added
GetOrientedBoundingEllipsoid()method to all 3D geometry base classes (Geometry3D.h:74-75) - Support for PointCloud, TriangleMesh, LineSet, VoxelGrid, and Octree
- Added
- Ellipsoid mesh generation:
- TriangleMesh::CreateEllipsoid() - creates ellipsoid mesh primitives
- LineSet::CreateFromOrientedBoundingEllipsoid() - wireframe representation
- Transformation operations:
- Translate, Rotate, Scale operations (BoundingVolume.cpp:75-96)
- Volume calculation (BoundingVolume.cpp:99-100)
- Visualization support:
- Renderer implementation in GeometryRenderer.cpp
- Shader support in SimpleShader.cpp
- Filament rendering backend integration
- 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])
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes.