open3d.t.geometry.OrientedBoundingEllipsoid#
- class open3d.t.geometry.OrientedBoundingEllipsoid#
A minimum-volume bounding ellipsoid oriented along an arbitrary frame of reference with the properties:
(
center,rotation,radii): The oriented bounding ellipsoid is defined by its center position (shape (3,)), rotation matrix (shape (3,3)) and semi-axis radii (shape (3,)). Each of these tensors must have the same data type and device. The data type can only beopen3d.core.float32(default) oropen3d.core.float64. The device of the tensor determines the device of the ellipsoid.color: Color of the bounding ellipsoid is a tensor with shape (3,) and a data typeopen3d.core.float32(default) oropen3d.core.float64. Values can only be in the range [0.0, 1.0].
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: open3d.t.geometry.OrientedBoundingEllipsoid, device: open3d.core.Device = Device(“CPU”, 0)) -> None
Construct an empty OrientedBoundingEllipsoid on the provided device.
__init__(self: open3d.t.geometry.OrientedBoundingEllipsoid, center: open3d.core.Tensor, rotation: open3d.core.Tensor, radii: open3d.core.Tensor) -> None
Construct an OrientedBoundingEllipsoid from center, rotation and radii. The OrientedBoundingEllipsoid will be created on the device of the given tensors, which must be on the same device and have the same data type.
__init__(self: open3d.t.geometry.OrientedBoundingEllipsoid, arg0: open3d.t.geometry.OrientedBoundingEllipsoid) -> None
Copy constructor
- clear(self: open3d.t.geometry.Geometry) open3d.t.geometry.Geometry#
Clear all elements in the geometry.
- Returns:
open3d.t.geometry.Geometry
- clone(self: open3d.t.geometry.OrientedBoundingEllipsoid) open3d.t.geometry.OrientedBoundingEllipsoid#
Returns a copy of the oriented bounding ellipsoid on the same device.
- cpu(self: open3d.t.geometry.OrientedBoundingEllipsoid) open3d.t.geometry.OrientedBoundingEllipsoid#
Transfer the oriented bounding ellipsoid to CPU. No-op if already on CPU.
- static create_from_points(points: open3d.core.Tensor, robust: bool = False) open3d.t.geometry.OrientedBoundingEllipsoid#
Creates the minimum-volume oriented bounding ellipsoid using Khachiyan’s algorithm.
- Parameters:
points (open3d.core.Tensor) – A list of points with data type of float32 or float64 (N x 3 tensor, where N must be larger than 3).
robust (bool) – If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.
- Returns:
OrientedBoundingEllipsoid with same data type and device as input points.
Example:
import open3d as o3d import open3d.t.geometry as o3g import numpy as np pcd = o3g.PointCloud() pcd.point["positions"] = o3d.core.Tensor( np.random.randn(100, 3).astype(np.float32)) obe = o3g.OrientedBoundingEllipsoid.create_from_points( pcd.point["positions"]) obe.set_color((0.0, 0.44, 0.77)) print(f"Volume: {obe.volume()}") print(f"Center: {obe.center}") print(f"Radii: {obe.radii}") # Option 1: wireframe visualization via LineSet ellipsoid_lines = o3g.LineSet.create_from_oriented_bounding_ellipsoid(obe) o3d.visualization.draw([pcd, ellipsoid_lines]) # Option 2: solid ellipsoid mesh ellipsoid_mesh = o3g.TriangleMesh.create_from_oriented_bounding_ellipsoid(obe) o3d.visualization.draw([pcd, ellipsoid_mesh])
- cuda(self: open3d.t.geometry.OrientedBoundingEllipsoid, device_id: SupportsInt = 0) open3d.t.geometry.OrientedBoundingEllipsoid#
Transfer the oriented bounding ellipsoid to a CUDA device.
- static from_legacy(ellipsoid: open3d.geometry.OrientedBoundingEllipsoid, dtype: open3d.core.Dtype = Float32, device: open3d.core.Device = Device('CPU', 0)) open3d.t.geometry.OrientedBoundingEllipsoid#
Create an OrientedBoundingEllipsoid from a legacy Open3D oriented bounding ellipsoid.
- get_axis_aligned_bounding_box(self: open3d.t.geometry.OrientedBoundingEllipsoid) open3d.t.geometry.AxisAlignedBoundingBox#
Returns the axis-aligned bounding box that contains this ellipsoid.
- get_ellipsoid_points(self: open3d.t.geometry.OrientedBoundingEllipsoid) open3d.core.Tensor#
Returns the six critical points of the bounding ellipsoid. Return tensor has shape {6, 3}.
- get_minimal_oriented_bounding_box(self: open3d.t.geometry.OrientedBoundingEllipsoid, robust: bool = False) open3d.t.geometry.OrientedBoundingBox#
Returns the minimal oriented bounding box around the ellipsoid.
- get_oriented_bounding_box(self: open3d.t.geometry.OrientedBoundingEllipsoid, robust: bool = False) open3d.t.geometry.OrientedBoundingBox#
Returns an oriented bounding box around the ellipsoid.
- get_point_indices_within_bounding_ellipsoid(self: open3d.t.geometry.OrientedBoundingEllipsoid, points: open3d.core.Tensor) open3d.core.Tensor#
Indices to points that are within the bounding ellipsoid.
- is_empty(self: open3d.t.geometry.Geometry) bool#
Returns
Trueiff the geometry is empty.- Returns:
bool
- rotate(self: open3d.t.geometry.OrientedBoundingEllipsoid, rotation: open3d.core.Tensor, center: open3d.core.Tensor | None = None) open3d.t.geometry.OrientedBoundingEllipsoid#
Rotate the oriented bounding ellipsoid.
- scale(self: open3d.t.geometry.OrientedBoundingEllipsoid, scale: SupportsFloat, center: open3d.core.Tensor | None = None) open3d.t.geometry.OrientedBoundingEllipsoid#
Scale the oriented bounding ellipsoid.
- set_center(self: open3d.t.geometry.OrientedBoundingEllipsoid, center: open3d.core.Tensor) None#
Set the center of the oriented bounding ellipsoid.
- set_color(self: open3d.t.geometry.OrientedBoundingEllipsoid, color: open3d.core.Tensor) None#
Set the color of the oriented bounding ellipsoid.
- set_radii(self: open3d.t.geometry.OrientedBoundingEllipsoid, radii: open3d.core.Tensor) None#
Set the semi-axis radii of the oriented bounding ellipsoid.
- set_rotation(self: open3d.t.geometry.OrientedBoundingEllipsoid, rotation: open3d.core.Tensor) None#
Set the rotation matrix of the oriented bounding ellipsoid.
- to(self: open3d.t.geometry.OrientedBoundingEllipsoid, device: open3d.core.Device, dtype: open3d.core.Dtype, copy: bool = False) open3d.t.geometry.OrientedBoundingEllipsoid#
Transfer the oriented bounding ellipsoid to a specified device.
- to_legacy(self: open3d.t.geometry.OrientedBoundingEllipsoid) open3d.geometry.OrientedBoundingEllipsoid#
Convert to a legacy Open3D oriented bounding ellipsoid.
- translate(self: open3d.t.geometry.OrientedBoundingEllipsoid, translation: open3d.core.Tensor, relative: bool = True) open3d.t.geometry.OrientedBoundingEllipsoid#
Translate the oriented bounding ellipsoid.
- volume(self: open3d.t.geometry.OrientedBoundingEllipsoid) float#
Returns the volume of the bounding ellipsoid.
- property center#
Center of the oriented bounding ellipsoid.
- property color#
Color of the oriented bounding ellipsoid.
- property device#
Returns the device of the geometry.
- property is_cpu#
Returns true if the geometry is on CPU.
- property is_cuda#
Returns true if the geometry is on CUDA.
- property radii#
Semi-axis radii of the oriented bounding ellipsoid.
- property rotation#
Rotation matrix of the oriented bounding ellipsoid.