Class: QgsPolygon3DSymbol

3D symbol that draws polygon geometries as planar polygons, optionally extruded (with added walls).

Warning

This is not considered stable API, and may change in future QGIS releases. It is exposed to the Python bindings as a tech preview only.

Class Hierarchy

Inheritance diagram of qgis._3d.QgsPolygon3DSymbol

Base classes

QgsAbstract3DSymbol

Abstract base class for 3D symbols that are used by VectorLayer3DRenderer objects.

class qgis._3d.QgsPolygon3DSymbol[source]

Bases: QgsAbstract3DSymbol

addBackFaces(self) bool[source]

Returns whether also triangles facing the other side will be created. Useful if input data have inconsistent order of vertices

Added in version 3.2.

Return type:

bool

altitudeBinding(self) Qgis.AltitudeBinding[source]

Returns method that determines how altitude is bound to individual vertices

Return type:

Qgis.AltitudeBinding

altitudeClamping(self) Qgis.AltitudeClamping[source]

Returns method that determines altitude (whether to clamp to feature to terrain)

Return type:

Qgis.AltitudeClamping

static create() QgsAbstract3DSymbol | None[source]

Creates a new QgsPolygon3DSymbol.

Caller takes ownership of the returned symbol.

Return type:

Optional[QgsAbstract3DSymbol]

cullingMode(self) Qgs3DTypes.CullingMode[source]

Returns front/back culling mode

Return type:

Qgs3DTypes.CullingMode

edgeColor(self) QColor[source]

Returns edge lines color

Added in version 3.8.

Return type:

QColor

edgeWidth(self) float[source]

Returns width of edge lines (in pixels)

Added in version 3.8.

Return type:

float

edgesEnabled(self) bool[source]

Returns whether edge highlighting is enabled

Added in version 3.8.

Return type:

bool

extrusionFaces(self) Qgis.ExtrusionFaces[source]

Returns the building extrusion sides to be rendered.

Added in version 4.0.

Return type:

Qgis.ExtrusionFaces

extrusionHeight(self) float[source]

Returns extrusion height (in map units)

Return type:

float

height(self) float[source]

Returns height (altitude) of the symbol (in map units)

Deprecated since version 3.36: Use offset() instead.

Return type:

float

invertNormals(self) bool[source]

Returns whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)

Return type:

bool

materialSettings(self) QgsAbstractMaterialSettings | None[source]

Returns material settings used for shading of the symbol

Return type:

Optional[QgsAbstractMaterialSettings]

offset(self) float[source]

Returns vertical offset of the symbol (in map units)

Added in version 3.36.

Return type:

float

renderedFacade(self) int[source]

Returns which facade of the buildings is rendered (0 for None, 1 for Walls, 2 for Roof, 3 for WallsAndRoof)

Added in version 3.16.

Deprecated since version 4.0: Use extrusionFaces() instead.

Return type:

int

setAddBackFaces(self, add: bool)[source]

Sets whether also triangles facing the other side will be created. Useful if input data have inconsistent order of vertices

Added in version 3.2.

Parameters:

add (bool)

setAltitudeBinding(self, altBinding: Qgis.AltitudeBinding)[source]

Sets method that determines how altitude is bound to individual vertices

Parameters:

altBinding (Qgis.AltitudeBinding)

setAltitudeClamping(self, altClamping: Qgis.AltitudeClamping)[source]

Sets method that determines altitude (whether to clamp to feature to terrain)

Parameters:

altClamping (Qgis.AltitudeClamping)

setCullingMode(self, mode: Qgs3DTypes.CullingMode)[source]

Sets front/back culling mode

Parameters:

mode (Qgs3DTypes.CullingMode)

setEdgeColor(self, color: QColor | Qt.GlobalColor)[source]

Sets edge lines color

Added in version 3.8.

Parameters:

color (Union[QColor, Qt.GlobalColor])

setEdgeWidth(self, width: float)[source]

Sets width of edge lines (in pixels)

Added in version 3.8.

Parameters:

width (float)

setEdgesEnabled(self, enabled: bool)[source]

Sets whether edge highlighting is enabled

Added in version 3.8.

Parameters:

enabled (bool)

setExtrusionFaces(self, side: Qgis.ExtrusionFaces | Qgis.ExtrusionFace)[source]

Sets the building extrusion sides to be rendered.

Added in version 4.0.

Parameters:

side (Union[Qgis.ExtrusionFaces, Qgis.ExtrusionFace])

setExtrusionHeight(self, extrusionHeight: float)[source]

Sets extrusion height (in map units)

Parameters:

extrusionHeight (float)

setHeight(self, height: float)[source]

Sets height (altitude) of the symbol (in map units)

Deprecated since version 3.36: Use setOffset() instead.

Parameters:

height (float)

setInvertNormals(self, invert: bool)[source]

Sets whether the normals of triangles will be inverted (useful for fixing clockwise / counter-clockwise face vertex orders)

Parameters:

invert (bool)

setMaterialSettings(self, materialSettings: QgsAbstractMaterialSettings | None)[source]

Sets the material settings used for shading of the symbol.

Ownership of material is transferred to the symbol.

Parameters:

materialSettings (Optional[QgsAbstractMaterialSettings])

setOffset(self, offset: float)[source]

Sets vertical offset of the symbol (in map units)

Added in version 3.36.

Parameters:

offset (float)

setRenderedFacade(self, side: int)[source]

Sets which facade of the buildings is rendered (0 for None, 1 for Walls, 2 for Roof, 3 for WallsAndRoof)

Added in version 3.16.

Deprecated since version 4.0: Use setExtrusionFaces() instead.

Parameters:

side (int)