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 aQgsBox3D
from two points representing opposite corners of the box. The box is normalized after construction.QgsBox3d(rect:
QgsRectangle
) Constructs aQgsBox3D
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
New in version 3.0.
- Parameters
xmin (float = 0) –
ymin (float = 0) –
zmin (float = 0) –
xmax (float = 0) –
ymax (float = 0) –
zmax –
-
contains
(self, other: QgsBox3d) → bool¶ Returns
True
when box contains other box.contains(self, point:
QgsPoint
) -> bool ReturnsTrue
when box contains apoint
.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.
- Parameters
other (QgsBox3d) –
- Return type
bool
-
depth
(self) → float¶ Returns the depth of the box.
See also
See also
- Return type
float
-
height
(self) → float¶ Returns the height of the box.
See also
See also
- Return type
float
-
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.- Parameters
other (QgsBox3d) –
- Return type
bool
-
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.- Return type
bool
-
normalize
(self)¶ Normalize the box so it has non-negative width/height/depth.
-
setXMaximum
(self, x: float)¶ Sets the maximum
x
value.See also
See also
- Parameters
x (float) –
-
setXMinimum
(self, x: float)¶ Sets the minimum
x
value.See also
See also
- Parameters
x (float) –
-
setYMaximum
(self, y: float)¶ Sets the maximum
y
value.See also
See also
- Parameters
y (float) –
-
setYMinimum
(self, y: float)¶ Sets the minimum
y
value.See also
See also
- Parameters
y (float) –
-
setZMaximum
(self, z: float)¶ Sets the maximum
z
value.See also
See also
- Parameters
z (float) –
-
setZMinimum
(self, z: float)¶ Sets the minimum
z
value.See also
See also
- Parameters
z (float) –
-
toRectangle
(self) → QgsRectangle¶ Converts the box to a 2D rectangle.
- Return type
-
volume
(self) → float¶ Returns the volume of the box.
- Return type
float
-
width
(self) → float¶ Returns the width of the box.
See also
See also
- Return type
float
-
xMaximum
(self) → float¶ Returns the maximum x value.
See also
See also
- Return type
float
-
xMinimum
(self) → float¶ Returns the minimum x value.
See also
See also
- Return type
float
-
yMaximum
(self) → float¶ Returns the maximum y value.
See also
See also
- Return type
float
-
yMinimum
(self) → float¶ Returns the minimum y value.
See also
See also
- Return type
float
-
zMaximum
(self) → float¶ Returns the maximum z value.
See also
See also
- Return type
float
-
zMinimum
(self) → float¶ Returns the minimum z value.
See also
See also
- Return type
float