78 bool copy =
false)
const;
132 bool relative =
true);
349 bool relative =
true);
Tensor Prod(const SizeVector &dims, bool keepdim=false) const
Tensor Max(const SizeVector &dims, bool keepdim=false) const
A bounding box that is aligned along the coordinate axes and defined by the min_bound and max_bound.
core::Tensor color_
The color of the bounding box in RGB. The default is white.
cloudViewer::geometry::AxisAlignedBoundingBox ToLegacy() const
Convert to a legacy CloudViewer axis-aligned box.
core::Tensor GetMinBound() const
core::Tensor max_bound_
The upper x, y, z bounds of the bounding box.
core::Tensor GetExtent() const
Get the extent/length of the bounding box in x, y, and z dimension.
core::Tensor GetPointIndicesWithinBoundingBox(const core::Tensor &points) const
Indices to points that are within the bounding box.
static AxisAlignedBoundingBox FromLegacy(const cloudViewer::geometry::AxisAlignedBoundingBox &box, const core::Dtype &dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
void SetColor(const core::Tensor &color)
Set the color of the box. If the data type of the given tensor differs from the data type of the box,...
static AxisAlignedBoundingBox CreateFromPoints(const core::Tensor &points)
core::Tensor GetCenter() const
core::Tensor min_bound_
The lower x, y, z bounds of the bounding box.
core::Device device_
The device to use for the bounding box. The default is CPU:0.
core::Device GetDevice() const override
Returns the device attribute of this AxisAlignedBoundingBox.
double GetXPercentage(double x) const
void SetMinBound(const core::Tensor &min_bound)
Set the min bound of the box. If the data type of the given tensor differs from the data type of the ...
AxisAlignedBoundingBox To(const core::Device &device, bool copy=false) const
Transfer the AxisAlignedBoundingBox to a specified device.
AxisAlignedBoundingBox & operator+=(const AxisAlignedBoundingBox &other)
Add operation for axis-aligned bounding box. The device of other box must be the same as the device o...
AxisAlignedBoundingBox Clone() const
Returns copy of the AxisAlignedBoundingBox on the same device.
AxisAlignedBoundingBox(const core::Device &device=core::Device("CPU:0"))
Construct an empty AxisAlignedBoundingBox on the provided device.
core::Tensor GetMaxBound() const
bool IsEmpty() const override
Returns true iff the geometry is empty.
double GetZPercentage(double z) const
core::Tensor GetColor() const
double GetMaxExtent() const
Returns the maximum extent, i.e. the maximum of X, Y and Z axis' extents.
AxisAlignedBoundingBox & Clear() override
Clear all elements in the geometry.
core::Dtype dtype_
The data type of the bounding box.
double GetYPercentage(double y) const
OrientedBoundingBox GetOrientedBoundingBox() const
Convert to an oriented box.
virtual ~AxisAlignedBoundingBox() override
core::Tensor GetHalfExtent() const
Returns the half extent of the bounding box.
void SetMaxBound(const core::Tensor &max_bound)
Set the max bound of the box. If the data type of the given tensor differs from the data type of the ...
AxisAlignedBoundingBox & Scale(double scale, const utility::optional< core::Tensor > ¢er=utility::nullopt)
Scale the axis-aligned box. If is the min_bound and is the max_bound of the axis aligned bounding b...
core::Tensor GetBoxPoints() const
Returns the eight points that define the bounding box.
std::string ToString() const
Text description.
AxisAlignedBoundingBox & Translate(const core::Tensor &translation, bool relative=true)
Translate the axis-aligned box by the given translation.
core::Dtype GetDtype() const
Returns the data type attribute of this AxisAlignedBoundingBox.
double Volume() const
Returns the volume of the bounding box.
Mix-in class for geometry types that can be visualized.
A bounding box oriented along an arbitrary frame of reference.
OrientedBoundingBox(const core::Device &device=core::Device("CPU:0"))
Construct an empty OrientedBoundingBox on the provided device.
OrientedBoundingBox & Rotate(const core::Tensor &rotation, const utility::optional< core::Tensor > ¢er=utility::nullopt)
Rotate the oriented box by the given rotation matrix. If the rotation matrix is not orthogonal,...
AxisAlignedBoundingBox GetAxisAlignedBoundingBox() const
Convert to an axis-aligned box.
OrientedBoundingBox To(const core::Device &device, bool copy=false) const
virtual ~OrientedBoundingBox() override
void SetExtent(const core::Tensor &extent)
Set the extent of the box. If the data type of the given tensor differs from the data type of the box...
OrientedBoundingBox Clone() const
Returns copy of the OrientedBoundingBox on the same device.
cloudViewer::geometry::OrientedBoundingBox ToLegacy() const
Convert to a legacy CloudViewer oriented box.
core::Dtype GetDtype() const
Returns the data type attribute of this OrientedBoundingBox.
core::Tensor GetExtent() const
core::Tensor GetMaxBound() const
OrientedBoundingBox & Scale(double scale, const utility::optional< core::Tensor > ¢er=utility::nullopt)
Scale the axis-aligned box. If is the min_bound and is the max_bound of the axis aligned bounding b...
OrientedBoundingBox & Clear() override
Clear all elements in the geometry.
bool IsEmpty() const override
Returns true iff the geometry is empty.
static OrientedBoundingBox CreateFromPoints(const core::Tensor &points, bool robust=false, MethodOBBCreate method=MethodOBBCreate::MINIMAL_APPROX)
OrientedBoundingBox & Transform(const core::Tensor &transformation)
Transform the oriented box by the given transformation matrix.
OrientedBoundingBox & Translate(const core::Tensor &translation, bool relative=true)
Translate the oriented box by the given translation. If relative is true, the translation is added to...
static OrientedBoundingBox CreateFromAxisAlignedBoundingBox(const AxisAlignedBoundingBox &aabb)
void SetCenter(const core::Tensor ¢er)
Set the center of the box. If the data type of the given tensor differs from the data type of the box...
core::Tensor GetBoxPoints() const
Returns the eight points that define the bounding box.
core::Device GetDevice() const override
Returns the device attribute of this OrientedBoundingBox.
static OrientedBoundingBox FromLegacy(const cloudViewer::geometry::OrientedBoundingBox &box, const core::Dtype &dtype=core::Float32, const core::Device &device=core::Device("CPU:0"))
core::Tensor GetPointIndicesWithinBoundingBox(const core::Tensor &points) const
Indices to points that are within the bounding box.
std::string ToString() const
Text description.
void SetRotation(const core::Tensor &rotation)
Set the rotation matrix of the box. If the data type of the given tensor differs from the data type o...
core::Tensor GetMinBound() const
double Volume() const
Returns the volume of the bounding box.
void SetColor(const core::Tensor &color)
Set the color of the box.
core::Tensor GetColor() const
core::Tensor GetCenter() const
core::Tensor GetRotation() const
::ecvOrientedBBox OrientedBoundingBox
@ MINIMAL_APPROX
Minimal OBB approximation.
constexpr nullopt_t nullopt
Generic file read and write utility for python interface.