open3d.t.geometry.OrientedBoundingBox¶
-
class
open3d.t.geometry.
OrientedBoundingBox
¶ A bounding box oriented along an arbitrary frame of reference. - (center, rotation, extent): The oriented bounding box is defined by its center position, rotation maxtrix and extent.
- Usage
OrientedBoundingBox::GetCenter()
OrientedBoundingBox::SetCenter(const core::Tensor ¢er)
OrientedBoundingBox::GetRotation()
OrientedBoundingBox::SetRotation(const core::Tensor &rotation)
Value tensor of center and extent must have shape {3,}.
Value tensor of rotation must have shape {3, 3}.
Value tensor must have the same data type and device.
Value tensor can only be float32 (default) or float64.
The device of the tensor determines the device of the box.
- color: Color of the bounding box.
- Usage
OrientedBoundingBox::GetColor()
OrientedBoundingBox::SetColor(const core::Tensor &color)
Value tensor must have shape {3,}.
Value tensor can only be float32 (default) or float64.
Value tensor can only be range [0.0, 1.0].
-
__init__
(*args, **kwargs)¶ Overloaded function.
__init__(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox, device: open3d.cpu.pybind.core.Device = CPU:0) -> None
Construct an empty OrientedBoundingBox on the provided device.
__init__(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox, center: open3d.cpu.pybind.core.Tensor, rotation: open3d.cpu.pybind.core.Tensor, extent: open3d.cpu.pybind.core.Tensor) -> None
Construct an OrientedBoundingBox from center, rotation and extent. The OrientedBoundingBox 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.cpu.pybind.t.geometry.OrientedBoundingBox, arg0: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) -> None
Copy constructor
-
clear
(self)¶ Clear all elements in the geometry.
- Returns
open3d.t.geometry.Geometry
-
clone
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Returns copy of the oriented box on the same device.
-
cpu
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Transfer the oriented box to CPU. If the oriented box is already on CPU, no copy will be performed.
-
static
create_from_axis_aligned_bounding_box
(aabb)¶ Create an OrientedBoundingBox from a legacy Open3D oriented box.
- Parameters
aabb (open3d.t.geometry.AxisAlignedBoundingBox) – AxisAlignedBoundingBox object from which OrientedBoundingBox is created.
- Returns
open3d.t.geometry.OrientedBoundingBox
-
static
create_from_points
(points, robust=(with default value))¶ Creates an oriented bounding box using a PCA. Note that this is only an approximation to the minimum oriented bounding box that could be computed for example with O’Rourke’s algorithm (cf. http://cs.smith.edu/~jorourke/Papers/MinVolBox.pdf, https://www.geometrictools.com/Documentation/MinimumVolumeBox.pdf) This is a wrapper for a CPU implementation.
- 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, optional) –
If set to true uses a more robust method which works in degenerate cases but introduces noise to the points coordinates. Default value:
False) -> open3d.t.geometry.OrientedBoundingBox Creates an oriented bounding box using a PCA. Note that this is only an approximation to the minimum oriented bounding box that could be computed for example with O’Rourke’s algorithm (cf. http://cs.smith.edu/~jorourke/Papers/MinVolBox.pdf
()
- Returns
open3d.t.geometry.OrientedBoundingBox
-
cuda
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox, device_id: int = 0) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Transfer the oriented box to a CUDA device. If the oriented box is already on the specified CUDA device, no copy will be performed.
-
static
from_legacy
(box: open3d.cpu.pybind.geometry.OrientedBoundingBox, dtype: open3d.cpu.pybind.core.Dtype = Float32, device: open3d.cpu.pybind.core.Device = CPU:0) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Create an oriented bounding box from the AxisAlignedBoundingBox.
-
get_axis_aligned_bounding_box
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Returns an oriented bounding box from the AxisAlignedBoundingBox.
-
get_box_points
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the eight points that define the bounding box. The Return tensor has shape {8, 3} and data type same as the box.
-
get_max_bound
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the max bound for box.
-
get_min_bound
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the min bound for box.
-
get_point_indices_within_bounding_box
(self, points)¶ Indices to points that are within the bounding box.
- Parameters
points (open3d.core.Tensor) – Tensor with {N, 3} shape, and type float32 or float64.
- Returns
open3d.core.Tensor
-
has_valid_material
(self: open3d.cpu.pybind.t.geometry.DrawableGeometry) → bool¶ Returns true if the geometry’s material is valid.
-
is_empty
(self)¶ Returns
True
iff the geometry is empty.- Returns
bool
-
rotate
(self, rotation, center=None)¶ Rotate the oriented box by the given rotation matrix. If the rotation matrix is not orthogonal, the rotation will no be applied. The rotation center will be the box center if it is not specified.
- Parameters
rotation (open3d.core.Tensor) – Rotation matrix of shape {3, 3}, type float32 or float64, device same as the box.
center (Optional[open3d.core.Tensor], optional, default=None) – Center of the rotation, default is null, which means use center of the box as rotation center.
- Returns
open3d.t.geometry.OrientedBoundingBox
-
scale
(self, scale, center=None)¶ Scale the axis-aligned box. If f$mif$ is the min_bound and f$maf$ is the max_bound of the axis aligned bounding box, and f$sf$ and f$cf$ are the provided scaling factor and center respectively, then the new min_bound and max_bound are given by f$mi = c + s (mi - c)f$ and f$ma = c + s (ma - c)f$. The scaling center will be the box center if it is not specified.
- Parameters
scale (float) – The scale parameter.
center (Optional[open3d.core.Tensor], optional, default=None) – Center used for the scaling operation. Tensor with {3,} shape, and type float32 or float64
- Returns
open3d.t.geometry.OrientedBoundingBox
-
set_center
(self, center)¶ Set the center of the box.
- Parameters
center (open3d.core.Tensor) – Tensor with {3,} shape, and type float32 or float64.
- Returns
None
-
set_color
(self, color)¶ Set the color of the oriented box.
- Parameters
color (open3d.core.Tensor) – Tensor with {3,} shape, and type float32 or float64, with values in range [0.0, 1.0].
- Returns
None
-
set_extent
(self, extent)¶ Set the extent of the box.
- Parameters
extent (open3d.core.Tensor) – Tensor with {3,} shape, and type float32 or float64.
- Returns
None
-
set_rotation
(self, rotation)¶ Set the rotation matrix of the box.
- Parameters
rotation (open3d.core.Tensor) – Tensor with {3, 3} shape, and type float32 or float64.
- Returns
None
-
to
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox, device: open3d.cpu.pybind.core.Device, copy: bool = False) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Transfer the oriented box to a specified device.
-
to_legacy
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → open3d.cpu.pybind.geometry.OrientedBoundingBox¶ Convert to a legacy Open3D oriented box.
-
transform
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox, transformation: open3d.cpu.pybind.core.Tensor) → open3d.cpu.pybind.t.geometry.OrientedBoundingBox¶ Transform the oriented box by the given transformation matrix.
-
translate
(self, translation, relative=True)¶ Translate the oriented box by the given translation. If relative is true, the translation is added to the center of the box. If false, the center will be assigned to the translation.
- Parameters
translation (open3d.core.Tensor) – Translation tensor of shape {3,}, type float32 or float64, device same as the box.
relative (bool, optional, default=True) – Whether to perform relative translation.
- Returns
open3d.t.geometry.OrientedBoundingBox
-
volume
(self: open3d.cpu.pybind.t.geometry.OrientedBoundingBox) → float¶ Returns the volume of the bounding box.
-
property
center
¶ Returns the center for box.
-
property
color
¶ Returns the color for box.
-
property
device
¶ Returns the device of the geometry.
-
property
dtype
¶ Returns the data type attribute of this OrientedBoundingBox.
-
property
extent
¶ Returns the extent for box coordinates.
-
property
is_cpu
¶ Returns true if the geometry is on CPU.
-
property
is_cuda
¶ Returns true if the geometry is on CUDA.
-
property
material
¶
-
property
rotation
¶ Returns the rotation for box.