Open3D (C++ API)  0.19.0
Public Member Functions | Static Public Member Functions | Protected Attributes
open3d::t::geometry::OrientedBoundingEllipsoid Class Reference

A bounding ellipsoid oriented along an arbitrary frame of reference. More...

#include <BoundingVolume.h>

Inheritance diagram for open3d::t::geometry::OrientedBoundingEllipsoid:
open3d::t::geometry::Geometry open3d::core::IsDevice

Public Member Functions

 OrientedBoundingEllipsoid (const core::Device &device=core::Device("CPU:0"))
 Construct an empty OrientedBoundingEllipsoid on the provided device. More...
 
 OrientedBoundingEllipsoid (const core::Tensor &center, const core::Tensor &rotation, const core::Tensor &radii)
 Construct an OrientedBoundingEllipsoid from center, rotation and radii. More...
 
virtual ~OrientedBoundingEllipsoid () override
 
core::Device GetDevice () const override
 Returns the device attribute of this OrientedBoundingEllipsoid. More...
 
core::Dtype GetDtype () const
 Returns the data type attribute of this OrientedBoundingEllipsoid. More...
 
OrientedBoundingEllipsoid To (const core::Device &device, const core::Dtype &dtype, bool copy=false) const
 
OrientedBoundingEllipsoid Clone () const
 Returns copy of the OrientedBoundingEllipsoid on the same device. More...
 
OrientedBoundingEllipsoidClear () override
 Clear all elements in the geometry. More...
 
bool IsEmpty () const override
 Returns true iff the geometry is empty. More...
 
void SetCenter (const core::Tensor &center)
 Set the center of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown. More...
 
void SetRotation (const core::Tensor &rotation)
 Set the rotation matrix of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown. More...
 
void SetRadii (const core::Tensor &radii)
 Set the radii of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown. More...
 
void SetColor (const core::Tensor &color)
 Set the color of the ellipsoid. More...
 
core::Tensor GetMinBound () const
 
core::Tensor GetMaxBound () const
 
core::Tensor GetColor () const
 
core::Tensor GetCenter () const
 
core::Tensor GetRotation () const
 
core::Tensor GetRadii () const
 
OrientedBoundingEllipsoidTranslate (const core::Tensor &translation, bool relative=true)
 Translate the oriented ellipsoid by the given translation. If relative is true, the translation is added to the center of the ellipsoid. If false, the center will be assigned to the translation. More...
 
OrientedBoundingEllipsoidRotate (const core::Tensor &rotation, const std::optional< core::Tensor > &center=std::nullopt)
 Rotate the oriented ellipsoid by the given rotation matrix. If the rotation matrix is not orthogonal, the rotation will not be applied. The rotation center will be the ellipsoid center if it is not specified. More...
 
OrientedBoundingEllipsoidScale (double scale, const std::optional< core::Tensor > &center=std::nullopt)
 Scale the oriented ellipsoid. The scaling center will be the ellipsoid center if it is not specified. More...
 
double Volume () const
 Returns the volume of the bounding ellipsoid. More...
 
core::Tensor GetEllipsoidPoints () const
 Returns the six critical points of the bounding ellipsoid. More...
 
core::Tensor GetPointIndicesWithinBoundingEllipsoid (const core::Tensor &points) const
 Indices to points that are within the bounding ellipsoid. More...
 
std::string ToString () const
 Text description. More...
 
open3d::geometry::OrientedBoundingEllipsoid ToLegacy () const
 Convert to a legacy Open3D oriented bounding ellipsoid. More...
 
AxisAlignedBoundingBox GetAxisAlignedBoundingBox () const
 Convert to an axis-aligned box. More...
 
OrientedBoundingBox GetOrientedBoundingBox (bool robust=false) const
 Returns an oriented bounding box around the ellipsoid. More...
 
OrientedBoundingBox GetMinimalOrientedBoundingBox (bool robust=false) const
 Returns the minimal oriented bounding box around the ellipsoid. More...
 
- Public Member Functions inherited from open3d::t::geometry::Geometry
virtual ~Geometry ()
 
GeometryType GetGeometryType () const
 Returns one of registered geometry types. More...
 
int Dimension () const
 Returns whether the geometry is 2D or 3D. More...
 
std::string GetName () const
 
void SetName (const std::string &name)
 
- Public Member Functions inherited from open3d::core::IsDevice
 IsDevice ()=default
 
virtual ~IsDevice ()=default
 
bool IsCPU () const
 
bool IsCUDA () const
 
bool IsSYCL () const
 

Static Public Member Functions

static OrientedBoundingEllipsoid FromLegacy (const open3d::geometry::OrientedBoundingEllipsoid &ellipsoid, const core::Dtype &dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
 
static OrientedBoundingEllipsoid CreateFromPoints (const core::Tensor &points, bool robust=false)
 

Protected Attributes

core::Device device_ = core::Device("CPU:0")
 
core::Dtype dtype_ = core::Float32
 
core::Tensor center_
 
core::Tensor rotation_
 
core::Tensor radii_
 
core::Tensor color_
 

Additional Inherited Members

- Public Types inherited from open3d::t::geometry::Geometry
enum class  GeometryType {
  Unspecified = 0 , PointCloud = 1 , VoxelGrid = 2 , Octree = 3 ,
  LineSet = 4 , MeshBase = 5 , TriangleMesh = 6 , HalfEdgeTriangleMesh = 7 ,
  Image = 8 , RGBDImage = 9 , TetraMesh = 10 , OrientedBoundingBox = 11 ,
  AxisAlignedBoundingBox = 12 , OrientedBoundingEllipsoid = 13
}
 Specifies possible geometry types. More...
 
- Protected Member Functions inherited from open3d::t::geometry::Geometry
 Geometry (GeometryType type, int dimension)
 Parameterized Constructor. More...
 

Detailed Description

A bounding ellipsoid oriented along an arbitrary frame of reference.

Constructor & Destructor Documentation

◆ OrientedBoundingEllipsoid() [1/2]

open3d::t::geometry::OrientedBoundingEllipsoid::OrientedBoundingEllipsoid ( const core::Device device = core::Device("CPU:0"))

Construct an empty OrientedBoundingEllipsoid on the provided device.

◆ OrientedBoundingEllipsoid() [2/2]

open3d::t::geometry::OrientedBoundingEllipsoid::OrientedBoundingEllipsoid ( const core::Tensor center,
const core::Tensor rotation,
const core::Tensor radii 
)

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.

Parameters
centerCenter of the bounding ellipsoid. Tensor of shape {3,}, and type float32 or float64.
rotationRotation matrix of the bounding ellipsoid. Tensor of shape {3, 3}, and type float32 or float64.
radiiRadii of the bounding ellipsoid along the three principal axes. Tensor of shape {3,}, and type float32 or float64.

◆ ~OrientedBoundingEllipsoid()

virtual open3d::t::geometry::OrientedBoundingEllipsoid::~OrientedBoundingEllipsoid ( )
inlineoverridevirtual

Member Function Documentation

◆ Clear()

OrientedBoundingEllipsoid & open3d::t::geometry::OrientedBoundingEllipsoid::Clear ( )
overridevirtual

Clear all elements in the geometry.

Implements open3d::t::geometry::Geometry.

◆ Clone()

OrientedBoundingEllipsoid open3d::t::geometry::OrientedBoundingEllipsoid::Clone ( ) const
inline

Returns copy of the OrientedBoundingEllipsoid on the same device.

◆ CreateFromPoints()

OrientedBoundingEllipsoid open3d::t::geometry::OrientedBoundingEllipsoid::CreateFromPoints ( const core::Tensor points,
bool  robust = false 
)
static

Creates the oriented bounding ellipsoid with the smallest volume using Khachiyan's algorithm.

Parameters
pointsA list of points with data type of float32 or float64 (N x 3 tensor, where N must be larger than 3).
robustIf 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.

◆ FromLegacy()

OrientedBoundingEllipsoid open3d::t::geometry::OrientedBoundingEllipsoid::FromLegacy ( const open3d::geometry::OrientedBoundingEllipsoid ellipsoid,
const core::Dtype dtype = core::Float32,
const core::Device device = core::Device("CPU:0") 
)
static

Create an OrientedBoundingEllipsoid from a legacy Open3D oriented bounding ellipsoid.

Parameters
ellipsoidLegacy OrientedBoundingEllipsoid.
dtypeThe data type of the ellipsoid for center, radii and color. The default is float32.
deviceThe device of the ellipsoid. The default is CPU:0.

◆ GetAxisAlignedBoundingBox()

AxisAlignedBoundingBox open3d::t::geometry::OrientedBoundingEllipsoid::GetAxisAlignedBoundingBox ( ) const

Convert to an axis-aligned box.

◆ GetCenter()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetCenter ( ) const
inline

◆ GetColor()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetColor ( ) const
inline

◆ GetDevice()

core::Device open3d::t::geometry::OrientedBoundingEllipsoid::GetDevice ( ) const
inlineoverridevirtual

Returns the device attribute of this OrientedBoundingEllipsoid.

Implements open3d::t::geometry::Geometry.

◆ GetDtype()

core::Dtype open3d::t::geometry::OrientedBoundingEllipsoid::GetDtype ( ) const
inline

Returns the data type attribute of this OrientedBoundingEllipsoid.

◆ GetEllipsoidPoints()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetEllipsoidPoints ( ) const

Returns the six critical points of the bounding ellipsoid.

The Return tensor has shape {6, 3} and data type same as the ellipsoid.

*      ------- x
*     /|
*    / |
*   /  | z
*  y
*                            2
*                         .--|---.
*                    .--'    |     '--.
*               .--'         |          '--.
*            .'              |   4           '.
*           /                |  /              \
*          /                 | /                \
*       0 |------------------|-------------------| 1
*          \               / |                  /
*           \             /  |                 /
*            '.         5    |               .'
*               '--.         |          .--'
*                    '--.    |     .--'
*                         '--|---'
*                            3
* 

◆ GetMaxBound()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetMaxBound ( ) const

◆ GetMinBound()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetMinBound ( ) const

◆ GetMinimalOrientedBoundingBox()

OrientedBoundingBox open3d::t::geometry::OrientedBoundingEllipsoid::GetMinimalOrientedBoundingBox ( bool  robust = false) const

Returns the minimal oriented bounding box around the ellipsoid.

◆ GetOrientedBoundingBox()

OrientedBoundingBox open3d::t::geometry::OrientedBoundingEllipsoid::GetOrientedBoundingBox ( bool  robust = false) const

Returns an oriented bounding box around the ellipsoid.

◆ GetPointIndicesWithinBoundingEllipsoid()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetPointIndicesWithinBoundingEllipsoid ( const core::Tensor points) const

Indices to points that are within the bounding ellipsoid.

Parameters
pointsTensor with {N, 3} shape, and type float32 or float64.

◆ GetRadii()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetRadii ( ) const
inline

◆ GetRotation()

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::GetRotation ( ) const
inline

◆ IsEmpty()

bool open3d::t::geometry::OrientedBoundingEllipsoid::IsEmpty ( ) const
inlineoverridevirtual

Returns true iff the geometry is empty.

Implements open3d::t::geometry::Geometry.

◆ Rotate()

OrientedBoundingEllipsoid & open3d::t::geometry::OrientedBoundingEllipsoid::Rotate ( const core::Tensor rotation,
const std::optional< core::Tensor > &  center = std::nullopt 
)

Rotate the oriented ellipsoid by the given rotation matrix. If the rotation matrix is not orthogonal, the rotation will not be applied. The rotation center will be the ellipsoid center if it is not specified.

Parameters
rotationRotation matrix of shape {3, 3}, type float32 or float64, device same as the ellipsoid.
centerCenter of the rotation, default is null, which means use center of the ellipsoid as rotation center.

◆ Scale()

OrientedBoundingEllipsoid & open3d::t::geometry::OrientedBoundingEllipsoid::Scale ( double  scale,
const std::optional< core::Tensor > &  center = std::nullopt 
)

Scale the oriented ellipsoid. The scaling center will be the ellipsoid center if it is not specified.

Parameters
scaleThe scale parameter.
centerCenter used for the scaling operation. Tensor of shape {3,}, type float32 or float64, device same as the ellipsoid.

◆ SetCenter()

void open3d::t::geometry::OrientedBoundingEllipsoid::SetCenter ( const core::Tensor center)

Set the center of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown.

Parameters
centerTensor with {3,} shape, and type float32 or float64.

◆ SetColor()

void open3d::t::geometry::OrientedBoundingEllipsoid::SetColor ( const core::Tensor color)

Set the color of the ellipsoid.

Parameters
colorTensor with {3,} shape, and type float32 or float64, with values in range [0.0, 1.0].

◆ SetRadii()

void open3d::t::geometry::OrientedBoundingEllipsoid::SetRadii ( const core::Tensor radii)

Set the radii of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown.

Parameters
radiiTensor with {3,} shape, and type float32 or float64.

◆ SetRotation()

void open3d::t::geometry::OrientedBoundingEllipsoid::SetRotation ( const core::Tensor rotation)

Set the rotation matrix of the ellipsoid. If the data type of the given tensor differs from the data type of the ellipsoid, an exception will be thrown.

Parameters
rotationTensor with {3, 3} shape, and type float32 or float64.

◆ To()

OrientedBoundingEllipsoid open3d::t::geometry::OrientedBoundingEllipsoid::To ( const core::Device device,
const core::Dtype dtype,
bool  copy = false 
) const

Transfer the OrientedBoundingEllipsoid to a specified device and dtype.

Parameters
deviceThe targeted device to convert to.
dtypeThe targeted data type (Float32 or Float64).
copyIf true, a new OrientedBoundingEllipsoid is always created; if false, the copy is avoided when the original OrientedBoundingEllipsoid is already on the targeted device and dtype.

◆ ToLegacy()

open3d::geometry::OrientedBoundingEllipsoid open3d::t::geometry::OrientedBoundingEllipsoid::ToLegacy ( ) const

Convert to a legacy Open3D oriented bounding ellipsoid.

◆ ToString()

std::string open3d::t::geometry::OrientedBoundingEllipsoid::ToString ( ) const

Text description.

◆ Translate()

OrientedBoundingEllipsoid & open3d::t::geometry::OrientedBoundingEllipsoid::Translate ( const core::Tensor translation,
bool  relative = true 
)

Translate the oriented ellipsoid by the given translation. If relative is true, the translation is added to the center of the ellipsoid. If false, the center will be assigned to the translation.

Parameters
translationTranslation tensor of shape {3,}, type float32 or float64, device same as the ellipsoid.
relativeWhether to perform relative translation.

◆ Volume()

double open3d::t::geometry::OrientedBoundingEllipsoid::Volume ( ) const

Returns the volume of the bounding ellipsoid.

Field Documentation

◆ center_

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::center_
protected

◆ color_

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::color_
protected

◆ device_

core::Device open3d::t::geometry::OrientedBoundingEllipsoid::device_ = core::Device("CPU:0")
protected

◆ dtype_

core::Dtype open3d::t::geometry::OrientedBoundingEllipsoid::dtype_ = core::Float32
protected

◆ radii_

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::radii_
protected

◆ rotation_

core::Tensor open3d::t::geometry::OrientedBoundingEllipsoid::rotation_
protected

The documentation for this class was generated from the following files: