Adding Minimum Bounding Sphere functionality#7511
Conversation
…CreateFromBoundnigSphere methods - the user can scale afterwards if scaling wanted
…CreateFromBoundnigSphere methods - the user can scale afterwards if scaling wanted v2
…tBoundingSphere from Geometry3D
…unding sphere computation
…andling and robust algorithms
…olver architecture
… update documentation and example usage in pybind interface
…mplemented Ritter's approximate algorithm
…pdate related documentation and method signatures
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
|
Hi @Pemar743, how does this add new functionality over the minimum bounding ellipsoid? You can always convert the minimum bounding ellipsoid to a min bounding sphere by just setting all radii the max ellipsoid radius. |
|
Hi @ssheorey, from experience the bounding sphere is both tighter (although marginal in many cases) and it can be orders quicker to compute. Example BunnyMesh Execution TimesOriented Bounding Ellipsoid: 16766.952 ms |
|
Hi @ssheorey, they also produce different radii and centers. Bunny Execution TimesOriented Bounding Ellipsoid: 19750.351 ms Bunny MetricsEllipsoid center: [-0.03425542 0.10323097 -0.0008773996] Sphere center: [-0.019763147 0.10807039 -0.010968389] import time
import open3d as o3d
dataset = o3d.data.BunnyMesh()
mesh = o3d.io.read_triangle_mesh(dataset.path)
mesh.compute_vertex_normals()
print("Mesh loaded.")
mesh_t = o3d.t.geometry.TriangleMesh.from_legacy(mesh)
t0 = time.perf_counter()
obe = mesh_t.get_oriented_bounding_ellipsoid()
t1 = time.perf_counter()
obe_time_ms = (t1 - t0) * 1000.0
obe.set_color((0.0, 0.8, 0.0))
t0 = time.perf_counter()
bs_exact = mesh_t.get_bounding_sphere(exact=True)
t1 = time.perf_counter()
bs_exact_time_ms = (t1 - t0) * 1000.0
bs_exact.set_color((0.0, 0.0, 0.8))
print("\nExecution Times")
print("----------------------------")
print(f"Oriented Bounding Ellipsoid: {obe_time_ms:.3f} ms")
print(f"Exact Sphere: {bs_exact_time_ms:.3f} ms")
print("\nMetrics")
print("----------------------------")
print(f"Ellipsoid center: {obe.center}")
print(f"Ellipsoid radii: {obe.radii}")
print(f"Sphere center: {bs_exact.center}")
print(f"Sphere radius: {bs_exact.radius}")
ellipsoid_lines = (
o3d.t.geometry.LineSet.create_from_oriented_bounding_ellipsoid(obe)
)
bounding_sphere_lines_exact = (
o3d.t.geometry.LineSet.create_from_bounding_sphere(bs_exact, resolution=20)
)
o3d.visualization.draw_geometries([
mesh_t.to_legacy(),
ellipsoid_lines.to_legacy(),
bounding_sphere_lines_exact.to_legacy(),
]) |
|
Hi @ssheorey, just following up to see if my previous comments helped clarify the distinction between the min bounding sphere and the min bounding ellipsoid? |


Add Minimum Bounding Sphere support to Open3D
Type
Motivation and Context
This change introduces support for computing Minimum Bounding Spheres. While Open3D currently supports axis-aligned and oriented bounding volumes, it lacks a native spherical bounding representation.
Recently, support for an Oriented Bounding Ellipsoid was introduced in Open3D (PR #7377), extending the available set of bounding primitives beyond boxes.
Bounding spheres complement these existing and emerging primitives by providing a simple, robust, and computationally efficient bounding volume.
Bounding spheres are useful in many applications, including:
This feature adds both approximate and exact methods for computing bounding spheres, giving users flexibility depending on performance and accuracy requirements.
Checklist:
python util/check_style.py --applyto apply Open3D code style to my code.Description
This PR adds a complete implementation of Minimum Bounding Sphere (BS) support across both legacy and tensor geometry APIs in Open3D.
Key Features:
PointCloudTriangleMeshLineSetAPI Changes:
BoundingSphereclass:CreateFromPointsmethods expose a flag to select between exact (Welzl) and approximate (Ritter) algorithmsImplementation Details:
cpp/open3d/t/geometry/kernel/MinimumBS.*Testing:
Exact Bounding Sphere
Approximate Bounding Sphere
Exact and Approximate Bounding Sphere
Notes:
Example usage