Class: QgsSphere¶
A spherical geometry object.
Represents a simple 3-dimensional sphere.
Added in version 3.34.
Methods
Returns the 3-dimensional bounding box containing the sphere. |
|
Returns the center point of the sphere. |
|
Returns the vector to the center of the sphere. |
|
Returns the x-coordinate of the center of the sphere. |
|
Returns the y-coordinate of the center of the sphere. |
|
Returns the z-coordinate of the center of the sphere. |
|
Returns the diameter of the sphere. |
|
Returns |
|
Returns |
|
Returns the radius of the sphere. |
|
Sets the center point of the sphere. |
|
Sets the radius of the sphere. |
|
Returns the surface area of the sphere. |
|
Converts the sphere to a 2-dimensional circle. |
|
Returns the volume of the sphere. |
- class qgis.core.QgsSphere[source]¶
Bases:
object
- __init__()
Constructor for an invalid QgsSphere.
- __init__(x: float, y: float, z: float, radius: float)
Constructor for QgsSphere with the specified center (
x
,y
,z
) andradius
.- Parameters:
x (float)
y (float)
z (float)
radius (float)
- boundingBox(self) QgsBox3D [source]¶
Returns the 3-dimensional bounding box containing the sphere.
- Return type:
- center(self) QgsPoint [source]¶
Returns the center point of the sphere.
See also
See also
See also
See also
- Return type:
- centerVector(self) QgsVector3D [source]¶
Returns the vector to the center of the sphere.
See also
See also
See also
See also
- Return type:
- centerX(self) float [source]¶
Returns the x-coordinate of the center of the sphere.
See also
See also
See also
See also
- Return type:
float
- centerY(self) float [source]¶
Returns the y-coordinate of the center of the sphere.
See also
See also
See also
See also
- Return type:
float
- centerZ(self) float [source]¶
Returns the z-coordinate of the center of the sphere.
See also
See also
See also
See also
- Return type:
float
- isEmpty(self) bool [source]¶
Returns
True
if the sphere is considered empty, i.e. it has a radius of 0.- Return type:
bool
- isNull(self) bool [source]¶
Returns
True
if the sphere is a null (default constructed) sphere.- Return type:
bool
- setCenter(self, center: QgsPoint)[source]¶
Sets the center point of the sphere.
See also
- Parameters:
center (
QgsPoint
)
- setCenter(self, x: float, y: float, z: float)[source]
Sets the center point of the sphere to (
x
,y
,z
).See also
- Parameters:
x (float)
y (float)
z (float)
- setRadius(self, radius: float)[source]¶
Sets the
radius
of the sphere.See also
- Parameters:
radius (float)