Class: QgsOrientedBox3D

class qgis.core.QgsOrientedBox3D

Bases: sip.wrapper

Represents a oriented (rotated) box in 3 dimensions.

Warning

Non-stable API, exposed to Python for unit testing only.

Added in version 3.34.

QgsOrientedBox3D() Constructor for a null oriented box.

QgsOrientedBox3D(center: Iterable[float], halfAxes: Iterable[float]) Constructor for a oriented box, with a specified center and half axes matrix.

QgsOrientedBox3D(center: QgsVector3D, halfAxes: Iterable[QgsVector3D]) Constructor for a oriented box, with a specified center and half axes matrix.

QgsOrientedBox3D(QgsOrientedBox3D)

Methods

center

Returns the vector to the center of the box.

centerX

Returns the center x-coordinate.

centerY

Returns the center y-coordinate.

centerZ

Returns the center z-coordinate.

corners

Returns an array of all corners as 3D vectors.

extent

Returns the overall bounding box of the object.

fromBox3D

Constructs an oriented box from an axis-aligned bounding box.

halfAxes

Returns the half axes matrix;

intersects

Returns True if the box intersects the other box.

isNull

Returns True if the box is a null box.

reprojectedExtent

Reprojects corners of this box using the given coordinate transform and returns axis-aligned box containing reprojected corners.

size

Returns size of sides of the box.

transformed

Returns box transformed by a 4x4 matrix.

center(self) QgsVector3D

Returns the vector to the center of the box.

Return type:

QgsVector3D

centerX(self) float

Returns the center x-coordinate.

See also

centerY()

See also

centerZ()

Return type:

float

centerY(self) float

Returns the center y-coordinate.

See also

centerX()

See also

centerZ()

Return type:

float

centerZ(self) float

Returns the center z-coordinate.

See also

centerX()

See also

centerY()

Return type:

float

corners(self) List[QgsVector3D]

Returns an array of all corners as 3D vectors.

Return type:

List[QgsVector3D]

extent(self) QgsBox3D

Returns the overall bounding box of the object.

Return type:

QgsBox3D

fromBox3D(box: QgsBox3D) QgsOrientedBox3D

Constructs an oriented box from an axis-aligned bounding box.

Parameters:

box (QgsBox3D)

Return type:

QgsOrientedBox3D

halfAxes(self) List[float]

Returns the half axes matrix;

Return type:

List[float]

intersects(self, other: QgsOrientedBox3D) bool

Returns True if the box intersects the other box.

Parameters:

other (QgsOrientedBox3D)

Return type:

bool

isNull(self) bool

Returns True if the box is a null box.

Return type:

bool

reprojectedExtent(self, ct: QgsCoordinateTransform) QgsBox3D

Reprojects corners of this box using the given coordinate transform and returns axis-aligned box containing reprojected corners.

Raises:

QgsCsException

Parameters:

ct (QgsCoordinateTransform)

Return type:

QgsBox3D

size(self) QgsVector3D

Returns size of sides of the box.

Return type:

QgsVector3D

transformed(self, transform: QgsMatrix4x4) QgsOrientedBox3D

Returns box transformed by a 4x4 matrix.

Parameters:

transform (QgsMatrix4x4)

Return type:

QgsOrientedBox3D