Class: QgsBox3d

class qgis.core.QgsBox3d(xmin: float = 0, ymin: float = 0, zmin: float = 0, xmax: float = 0, ymax: float = 0, zmax: float = 0)

Bases: sip.wrapper

Constructor for QgsBox3D which accepts the ranges of x/y/z coordinates.

QgsBox3d(p1: QgsPoint, p2: QgsPoint) Constructs a QgsBox3D from two points representing opposite corners of the box. The box is normalized after construction.

QgsBox3d(rect: QgsRectangle) Constructs a QgsBox3D from a rectangle. Z Minimum and Z Maximum are set to 0.0.

QgsBox3d(QgsBox3d)

A 3-dimensional box composed of x, y, z coordinates.

A box composed of x/y/z minimum and maximum values. It is often used to return the 3D extent of a geometry or collection of geometries.

See also

QgsRectangle

New in version 3.0: Enums

Methods

contains

Returns true when box contains other box.

depth

Returns the depth of the box.

height

Returns the height of the box.

intersect

Returns the intersection of this box and another 3D box.

intersects

Returns true if box intersects with another box.

is2d

Returns true if the box can be considered a 2-dimensional box, i.e.

normalize

Normalize the box so it has non-negative width/height/depth.

setXMaximum

Sets the maximum x value.

setXMinimum

Sets the minimum x value.

setYMaximum

Sets the maximum y value.

setYMinimum

Sets the minimum y value.

setZMaximum

Sets the maximum z value.

setZMinimum

Sets the minimum z value.

toRectangle

Converts the box to a 2D rectangle.

volume

Returns the volume of the box.

width

Returns the width of the box.

xMaximum

Returns the maximum x value.

xMinimum

Returns the minimum x value.

yMaximum

Returns the maximum y value.

yMinimum

Returns the minimum y value.

zMaximum

Returns the maximum z value.

zMinimum

Returns the minimum z value.

Signals

Attributes

contains(self, other: QgsBox3d) → bool

Returns true when box contains other box.

contains(self, point: QgsPoint) -> bool Returns true when box contains a point.

If the point is a 2D point (no z-coordinate), then the containment test will be performed on the x/y extent of the box only.

depth(self) → float

Returns the depth of the box.

See also

width()

See also

height()

height(self) → float

Returns the height of the box.

See also

width()

See also

depth()

intersect(self, other: QgsBox3d) → QgsBox3d

Returns the intersection of this box and another 3D box.

intersects(self, other: QgsBox3d) → bool

Returns true if box intersects with another box.

is2d(self) → bool

Returns true if the box can be considered a 2-dimensional box, i.e. it has equal minimum and maximum z values.

normalize(self)

Normalize the box so it has non-negative width/height/depth.

setXMaximum(self, x: float)

Sets the maximum x value.

See also

xMaximum()

See also

setXMinimum()

setXMinimum(self, x: float)

Sets the minimum x value.

See also

xMinimum()

See also

setXMaximum()

setYMaximum(self, y: float)

Sets the maximum y value.

See also

yMaximum()

See also

setYMinimum()

setYMinimum(self, y: float)

Sets the minimum y value.

See also

yMinimum()

See also

setYMaximum()

setZMaximum(self, z: float)

Sets the maximum z value.

See also

zMaximum()

See also

setZMinimum()

setZMinimum(self, z: float)

Sets the minimum z value.

See also

zMinimum()

See also

setZMaximum()

toRectangle(self) → QgsRectangle

Converts the box to a 2D rectangle.

volume(self) → float

Returns the volume of the box.

width(self) → float

Returns the width of the box.

See also

height()

See also

depth()

xMaximum(self) → float

Returns the maximum x value.

See also

setXMaximum()

See also

xMinimum()

xMinimum(self) → float

Returns the minimum x value.

See also

setXMinimum()

See also

xMaximum()

yMaximum(self) → float

Returns the maximum y value.

See also

setYMaximum()

See also

yMinimum()

yMinimum(self) → float

Returns the minimum y value.

See also

setYMinimum()

See also

yMaximum()

zMaximum(self) → float

Returns the maximum z value.

See also

setZMaximum()

See also

zMinimum()

zMinimum(self) → float

Returns the minimum z value.

See also

setZMinimum()

See also

zMaximum()