Class: QgsCrossSection¶
Encapsulates the definition of a cross section in 3D map coordinates.
Defined by a line (p1, p2) and a half-width (extent from the line).
Added in version 4.0.
Methods
Returns the cross section extent as a geometry (Polygon or LineString). |
|
Returns the end point of the cross section |
|
Returns the half-width of the cross section |
|
Returns cross section validity. |
|
Nudges the cross section to the left by the specified distance |
|
Nudges the cross section to the right by the specified distance |
|
Sets the half-width of the cross section |
|
Returns the start point of the cross section |
- class qgis._3d.QgsCrossSection[source]¶
Bases:
object- __init__()
Constructs an invalid cross section
- __init__(p1: QgsPoint, p2: QgsPoint, halfWidth: float)
Constructs a cross section defined by two points and a half-width
- __init__(a0: QgsCrossSection)
- Parameters:
a0 (QgsCrossSection)
- asGeometry(self, ct: QgsCoordinateTransform | None = None) QgsGeometry[source]¶
Returns the cross section extent as a geometry (Polygon or LineString). If a coordinate transform is provided, the geometry is transformed. The transform should be from the cross section CRS (3D map CRS) to the destination CRS (2D map canvas CRS).
- Parameters:
ct (Optional[QgsCoordinateTransform] = None)
- Return type:
- isValid(self) bool[source]¶
Returns cross section validity. A valid cross section has distinct start and end points and a positive half-width.
- Return type:
bool
- nudgeLeft(self, distance: float)[source]¶
Nudges the cross section to the left by the specified distance
- Parameters:
distance (float)
- nudgeRight(self, distance: float)[source]¶
Nudges the cross section to the right by the specified distance
- Parameters:
distance (float)