open3d.t.geometry.AxisAlignedBoundingBox¶
-
class
open3d.t.geometry.
AxisAlignedBoundingBox
¶ A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound.” - (min_bound, max_bound): Lower and upper bounds of the bounding box for all axes.
- Usage
AxisAlignedBoundingBox::GetMinBound()
AxisAlignedBoundingBox::SetMinBound(const core::Tensor &min_bound)
AxisAlignedBoundingBox::GetMaxBound()
AxisAlignedBoundingBox::SetMaxBound(const core::Tensor &max_bound)
Value tensor must have shape {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
AxisAlignedBoundingBox::GetColor()
AxisAlignedBoundingBox::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, device=CPU:0)
Construct an empty axis-aligned box on the provided device.
- Parameters
(open3d.core.Device (device) –
optional –
default=CPU –
- __init__(self, min_bound, max_bound)
Construct an axis-aligned box from min/max bound.
The axis-aligned box will be created on the device of the given bound tensor, which must be on the same device and have the same data type.
- Parameters
min_bound (open3d.core.Tensor) – Lower bounds of the bounding box for all axes. Tensor with {3,} shape, and type float32 or float64
max_bound (open3d.core.Tensor) – Upper bounds of the bounding box for all axes. Tensor with {3,} shape, and type float32 or float64
-
clear
(self)¶ Clear all elements in the geometry.
- Returns
open3d.t.geometry.Geometry
-
clone
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Returns copy of the axis-aligned box on the same device.
-
cpu
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Transfer the axis-aligned box to CPU. If the axis-aligned box is already on CPU, no copy will be performed.
-
static
create_from_points
(points)¶ Creates the axis-aligned box that encloses the set of points.
- 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).
- Returns
open3d.t.geometry.AxisAlignedBoundingBox
-
cuda
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox, device_id: int = 0) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Transfer the axis-aligned box to a CUDA device. If the axis-aligned box is already on the specified CUDA device, no copy will be performed.
-
static
from_legacy
(box: open3d.cpu.pybind.geometry.AxisAlignedBoundingBox, dtype: open3d.cpu.pybind.core.Dtype = Float32, device: open3d.cpu.pybind.core.Device = CPU:0) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Create an AxisAlignedBoundingBox from a legacy Open3D axis-aligned box.
-
get_box_points
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the eight points that define the bounding box. The Return tensor has shape {8, 3} and data type of float32.
-
get_center
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the center for box coordinates.
-
get_color
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the color for box.
-
get_extent
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Get the extent/length of the bounding box in x, y, and z dimension.
-
get_half_extent
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the half extent of the bounding box.
-
get_max_bound
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the max bound for box coordinates.
-
get_max_extent
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → float¶ Returns the maximum extent, i.e. the maximum of X, Y and Z axis’s extents.
-
get_min_bound
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.core.Tensor¶ Returns the min bound for box coordinates.
-
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
-
scale
(self, scale, center)¶ 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$.
- Parameters
scale (float) – The scale parameter.
center (open3d.core.Tensor) – Center used for the scaling operation. Tensor with {3,} shape, and type float32 or float64
- Returns
open3d.t.geometry.AxisAlignedBoundingBox
-
set_color
(self, color)¶ Set the color of the axis-aligned 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_max_bound
(self, max_bound)¶ Set the upper bound of the axis-aligned box.
- Parameters
max_bound (open3d.core.Tensor) – Tensor with {3,} shape, and type float32 or float64.
- Returns
None
-
set_min_bound
(self, min_bound)¶ Set the lower bound of the axis-aligned box.
- Parameters
min_bound (open3d.core.Tensor) – Tensor with {3,} shape, and type float32 or float64.
- Returns
None
-
to
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox, device: open3d.cpu.pybind.core.Device, copy: bool = False) → open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox¶ Transfer the axis-aligned box to a specified device.
-
to_legacy
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → open3d.cpu.pybind.geometry.AxisAlignedBoundingBox¶ Convert to a legacy Open3D axis-aligned box.
-
translate
(self, translation, relative=True)¶ Translate the axis-aligned box by the given translation. If relative is true, the translation is applied to the current min and max bound. If relative is false, the translation is applied to make the box’s center at the given 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.AxisAlignedBoundingBox
-
volume
(self: open3d.cpu.pybind.t.geometry.AxisAlignedBoundingBox) → float¶ Returns the volume of the bounding box.
-
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
material
¶