open3d.geometry.OrientedBoundingEllipsoid#
- class open3d.geometry.OrientedBoundingEllipsoid#
Class that defines an oriented ellipsoid that can be computed from 3D geometries.
- class Type(value)#
Enum class for Geometry types.
- HalfEdgeTriangleMesh = 7#
- Image = 8#
- LineSet = 4#
- PointCloud = 1#
- RGBDImage = 9#
- TetraMesh = 10#
- TriangleMesh = 6#
- Unspecified = 0#
- VoxelGrid = 2#
- __init__(*args, **kwargs)#
Overloaded function.
__init__(self: open3d.geometry.OrientedBoundingEllipsoid) -> None
Default constructor
__init__(self: open3d.geometry.OrientedBoundingEllipsoid, arg0: open3d.geometry.OrientedBoundingEllipsoid) -> None
Copy constructor
__init__(self: open3d.geometry.OrientedBoundingEllipsoid, center: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[3, 1]”], R: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[3, 3]”], radii: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, “[3, 1]”]) -> None
Create OrientedBoundingEllipsoid from center, rotation R and radii in x, y and z direction
- clear(self: open3d.geometry.Geometry) open3d.geometry.Geometry#
Clear all elements in the geometry.
- Returns:
open3d.geometry.Geometry
- static create_from_points(points: open3d.utility.Vector3dVector, robust: bool = False) open3d.geometry.OrientedBoundingEllipsoid#
Creates the oriented bounding ellipsoid that encloses the set of points.
Uses Khachiyan’s algorithm to compute the minimum volume enclosing ellipsoid. https://ecommons.cornell.edu/server/api/core/bitstreams/2b9e302e-e31c-45c9-b292-64a1c0d70bef/content
- Parameters:
points (open3d.utility.Vector3dVector) – Input points.
robust (bool) – If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.
- Returns:
The minimum volume oriented bounding ellipsoid.
- Return type:
Example:
import open3d as o3d # Compute oriented bounding ellipsoid from a mesh mesh_path = o3d.data.MonkeyModel().path mesh = o3d.io.read_triangle_mesh(mesh_path) mesh.compute_triangle_normals() ellipsoid = mesh.get_oriented_bounding_ellipsoid() print(f"Volume: {ellipsoid.volume()}") print(f"Center: {ellipsoid.center}") print(f"Radii: {ellipsoid.radii}") ellipsoid.color = (0, 0.44, 0.77) # Option 1: wireframe visualization via LineSet ellipsoid_lines = o3d.geometry.LineSet.create_from_oriented_bounding_ellipsoid(ellipsoid) o3d.visualization.draw([mesh, ellipsoid_lines]) # Option 2: solid ellipsoid mesh ellipsoid_mesh = o3d.geometry.TriangleMesh.create_from_oriented_bounding_ellipsoid(ellipsoid) o3d.visualization.draw([mesh, ellipsoid_mesh])
- dimension(self: open3d.geometry.Geometry) int#
Returns whether the geometry is 2D or 3D.
- Returns:
int
- get_axis_aligned_bounding_box(self: open3d.geometry.Geometry3D) open3d.geometry.AxisAlignedBoundingBox#
Returns an axis-aligned bounding box of the geometry.
- Returns:
open3d.geometry.AxisAlignedBoundingBox
- get_center(self: open3d.geometry.Geometry3D) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']#
Returns the center of the geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_geometry_type(self: open3d.geometry.Geometry) open3d.geometry.Geometry.Type#
Returns one of registered geometry types.
- Returns:
open3d.geometry.Geometry.Type
- get_max_bound(self: open3d.geometry.Geometry3D) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']#
Returns max bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_min_bound(self: open3d.geometry.Geometry3D) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 1]']#
Returns min bounds for geometry coordinates.
- Returns:
typing.Annotated[numpy.typing.NDArray[numpy.float64], “[3, 1]”]
- get_minimal_oriented_bounding_box(self: open3d.geometry.Geometry3D, robust: bool = False) open3d.geometry.OrientedBoundingBox#
Returns the minimal oriented bounding box for the geometry.
Creates the oriented bounding box with the smallest volume. The algorithm makes use of the fact that at least one edge of the convex hull must be collinear with an edge of the minimum bounding box: for each triangle in the convex hull, calculate the minimal axis aligned box in the frame of that triangle. at the end, return the box with the smallest volume
- Parameters:
robust (bool) – If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.
- Returns:
The oriented bounding box. The bounding box is oriented such that its volume is minimized.
- Return type:
- get_oriented_bounding_box(self: open3d.geometry.Geometry3D, robust: bool = False) open3d.geometry.OrientedBoundingBox#
Returns the oriented bounding box for the geometry.
Computes the oriented bounding box based on the PCA of the convex hull. The returned bounding box is an approximation to the minimal bounding box.
- Parameters:
robust (bool) – If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates.
- Returns:
The oriented bounding box. The bounding box is oriented such that the axes are ordered with respect to the principal components.
- Return type:
- static get_rotation_matrix_from_axis_angle(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_quaternion(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[4, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_xyz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_xzy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_yxz(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_yzx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_zxy(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- static get_rotation_matrix_from_zyx(rotation: Annotated[numpy.typing.ArrayLike, numpy.float64, '[3, 1]']) Annotated[numpy.typing.NDArray[numpy.float64], '[3, 3]']#
- is_empty(self: open3d.geometry.Geometry) bool#
Returns
Trueiff the geometry is empty.- Returns:
bool
- rotate(*args, **kwargs)#
Overloaded function.
- rotate(self: open3d.geometry.Geometry3D, R: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, ) -> open3d.geometry.Geometry3D
Apply rotation to the geometry coordinates and normals.
- Parameters:
R (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The rotation matrix
- Returns:
open3d.geometry.Geometry3D
- rotate(self: open3d.geometry.Geometry3D, R: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, , center: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, ) -> open3d.geometry.Geometry3D
Apply rotation to the geometry coordinates and normals.
- Parameters:
R (Annotated[numpy.typing.ArrayLike, numpy.float64,) – The rotation matrix
center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Rotation center used for transformation.
- Returns:
open3d.geometry.Geometry3D
- scale(*args, **kwargs)#
Overloaded function.
- scale(self: open3d.geometry.Geometry3D, scale: typing.SupportsFloat, center: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, ) -> open3d.geometry.Geometry3D
Apply scaling to the geometry coordinates.
- Parameters:
scale (SupportsFloat) – The scale parameter that is multiplied to the points/vertices of the geometry.
center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Scale center used for transformation.
- Returns:
open3d.geometry.Geometry3D
- scale(self: open3d.geometry.Geometry3D, scale: typing.SupportsFloat, center: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, ) -> open3d.geometry.Geometry3D
Apply scaling to the geometry coordinates.
- Parameters:
scale (SupportsFloat) – The scale parameter that is multiplied to the points/vertices of the geometry.
center (Annotated[numpy.typing.ArrayLike, numpy.float64,) – Scale center used for transformation.
- Returns:
open3d.geometry.Geometry3D
- transform(self: open3d.geometry.Geometry3D, arg0: typing.Annotated[numpy.typing.ArrayLike, numpy.float64) open3d.geometry.Geometry3D#
Apply transformation (4x4 matrix) to the geometry coordinates.
- Parameters:
arg0 (Annotated[numpy.typing.ArrayLike, numpy.float64,) –
- Returns:
open3d.geometry.Geometry3D
- translate(self: open3d.geometry.Geometry3D, translation: typing.Annotated[numpy.typing.ArrayLike, numpy.float64, relative: bool = True) open3d.geometry.Geometry3D#
Apply translation to the geometry coordinates.
- Parameters:
translation (Annotated[numpy.typing.ArrayLike, numpy.float64,) – A 3D vector to transform the geometry
relative (bool, optional, default=True) – If true, the translation vector is directly added to the geometry coordinates. Otherwise, the center is moved to the translation vector.
- Returns:
open3d.geometry.Geometry3D
- volume(self: open3d.geometry.OrientedBoundingEllipsoid) float#
Returns the volume of the bounding ellipsoid.
- Returns:
float
- HalfEdgeTriangleMesh = 7#
- Image = 8#
- LineSet = 4#
- PointCloud = 1#
- property R#
float64array of shape(3,3 )
- RGBDImage = 9#
- TetraMesh = 10#
- TriangleMesh = 6#
- Unspecified = 0#
- VoxelGrid = 2#
- property center#
float64array of shape(3, )
- property color#
float64array of shape(3, )
- property radii#
float64array of shape(3, )