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