open3d.t.geometry.AxisAlignedBoundingBox

class open3d.t.geometry.AxisAlignedBoundingBox

A bounding box that is aligned along the coordinate axes and has the properties:

  • (min_bound, max_bound): Lower and upper bounds of the bounding box for all axes. These are tensors with shape (3,) and a common data type and device. The data type can only be open3d.core.float32 (default) or open3d.core.float64. The device of the tensor determines the device of the box.

  • color: Color of the bounding box is a tensor with shape (3,) and a data type open3d.core.float32 (default) or open3d.core.float64. Values can only be in the range [0.0, 1.0].

__init__(*args, **kwargs)

Overloaded function.

  1. __init__(self: open3d.t.geometry.AxisAlignedBoundingBox, device: open3d.core.Device = CPU:0) -> None

Construct an empty axis-aligned box on the provided device.

  1. __init__(self: open3d.t.geometry.AxisAlignedBoundingBox, min_bound: open3d.core.Tensor, max_bound: open3d.core.Tensor) -> None

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.

  1. __init__(self: open3d.t.geometry.AxisAlignedBoundingBox, arg0: open3d.t.geometry.AxisAlignedBoundingBox) -> 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.AxisAlignedBoundingBox) open3d.t.geometry.AxisAlignedBoundingBox

Returns copy of the axis-aligned box on the same device.

cpu(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.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: open3d.core.Tensor) open3d.t.geometry.AxisAlignedBoundingBox

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).

Returns:

open3d.t.geometry.AxisAlignedBoundingBox

cuda(self: open3d.t.geometry.AxisAlignedBoundingBox, device_id: int = 0) open3d.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.geometry.AxisAlignedBoundingBox, dtype: open3d.core.Dtype = Float32, device: open3d.core.Device = CPU:0) open3d.t.geometry.AxisAlignedBoundingBox

Create an AxisAlignedBoundingBox from a legacy Open3D axis-aligned box.

get_box_points(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.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.t.geometry.AxisAlignedBoundingBox) open3d.core.Tensor

Returns the center for box coordinates.

get_extent(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.core.Tensor

Get the extent/length of the bounding box in x, y, and z dimension.

get_half_extent(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.core.Tensor

Returns the half extent of the bounding box.

get_max_extent(self: open3d.t.geometry.AxisAlignedBoundingBox) float

Returns the maximum extent, i.e. the maximum of X, Y and Z axis’s extents.

get_oriented_bounding_box(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.t.geometry.OrientedBoundingBox

Convert to an oriented box.

get_point_indices_within_bounding_box(self: open3d.t.geometry.AxisAlignedBoundingBox, points: open3d.core.Tensor) open3d.core.Tensor

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.t.geometry.DrawableGeometry) bool

Returns true if the geometry’s material is valid.

is_empty(self: open3d.t.geometry.Geometry) bool

Returns True iff the geometry is empty.

Returns:

bool

scale(self: open3d.t.geometry.AxisAlignedBoundingBox, scale: float, center: open3d.core.Tensor | None = None) open3d.t.geometry.AxisAlignedBoundingBox

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.AxisAlignedBoundingBox

set_color(self: open3d.t.geometry.AxisAlignedBoundingBox, color: open3d.core.Tensor) None

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: open3d.t.geometry.AxisAlignedBoundingBox, max_bound: open3d.core.Tensor) None

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: open3d.t.geometry.AxisAlignedBoundingBox, min_bound: open3d.core.Tensor) None

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.t.geometry.AxisAlignedBoundingBox, device: open3d.core.Device, copy: bool = False) open3d.t.geometry.AxisAlignedBoundingBox

Transfer the axis-aligned box to a specified device.

to_legacy(self: open3d.t.geometry.AxisAlignedBoundingBox) open3d.geometry.AxisAlignedBoundingBox

Convert to a legacy Open3D axis-aligned box.

translate(self: open3d.t.geometry.AxisAlignedBoundingBox, translation: open3d.core.Tensor, relative: bool = True) open3d.t.geometry.AxisAlignedBoundingBox

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.t.geometry.AxisAlignedBoundingBox) float

Returns the volume of the bounding 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 AxisAlignedBoundingBox.

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 max_bound

Returns the max bound for box coordinates.

property min_bound

Returns the min bound for box coordinates.