Class: QgsOrientedBox3D

Represents a oriented (rotated) box in 3 dimensions.

Warning

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

Added in version 3.34.

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.

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.

longestSide

Returns size of the longest side of the 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.

Static Methods

fromBox3D

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

class qgis.core.QgsOrientedBox3D[source]

Bases: object

__init__()

Constructor for a null oriented box.

__init__(center: Iterable[float], halfAxes: Iterable[float])

Constructor for a oriented box, with a specified center and half axes matrix.

Parameters:
  • center (Iterable[float])

  • halfAxes (Iterable[float])

__init__(center: QgsVector3D, halfAxes: Iterable[QgsVector3D])

Constructor for a oriented box, with a specified center and half axes matrix.

Parameters:
__init__(center: QgsVector3D, halfSizes: QgsVector3D, quaternion: QQuaternion)

Constructor for a oriented box, with a specified center, half sizes in each dimension and rotation.

Added in version 4.0.

Parameters:
__init__(a0: QgsOrientedBox3D)
Parameters:

a0 (QgsOrientedBox3D)

center(self) QgsVector3D[source]

Returns the vector to the center of the box.

Return type:

QgsVector3D

centerX(self) float[source]

Returns the center x-coordinate.

See also

centerY()

See also

centerZ()

Return type:

float

centerY(self) float[source]

Returns the center y-coordinate.

See also

centerX()

See also

centerZ()

Return type:

float

centerZ(self) float[source]

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[source]

Returns the overall bounding box of the object.

Return type:

QgsBox3D

static fromBox3D(box: QgsBox3D) QgsOrientedBox3D[source]

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[source]

Returns True if the box intersects the other box.

Parameters:

other (QgsOrientedBox3D)

Return type:

bool

isNull(self) bool[source]

Returns True if the box is a null box.

Return type:

bool

longestSide(self) float[source]

Returns size of the longest side of the box.

Added in version 4.0.

Return type:

float

reprojectedExtent(self, ct: QgsCoordinateTransform) QgsBox3D[source]

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[source]

Returns size of sides of the box.

Return type:

QgsVector3D

transformed(self, transform: QgsMatrix4x4) QgsOrientedBox3D[source]

Returns box transformed by a 4x4 matrix.

Parameters:

transform (QgsMatrix4x4)

Return type:

QgsOrientedBox3D