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.

Methods

addBackFaces

Returns whether also triangles facing the other side will be created.

altitudeBinding

Returns method that determines how altitude is bound to individual vertices

altitudeClamping

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

cullingMode

Returns front/back culling mode

edgeColor

Returns edge lines color

edgeWidth

Returns width of edge lines (in pixels)

edgesEnabled

Returns whether edge highlighting is enabled

extrusionHeight

Returns extrusion height (in map units)

height

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

invertNormals

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

materialSettings

Returns material settings used for shading of the symbol

offset

Returns vertical offset of the symbol (in map units)

renderedFacade

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

setAddBackFaces

Sets whether also triangles facing the other side will be created.

setAltitudeBinding

Sets method that determines how altitude is bound to individual vertices

setAltitudeClamping

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

setCullingMode

Sets front/back culling mode

setEdgeColor

Sets edge lines color

setEdgeWidth

Sets width of edge lines (in pixels)

setEdgesEnabled

Sets whether edge highlighting is enabled

setExtrusionHeight

Sets extrusion height (in map units)

setHeight

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

setInvertNormals

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

setMaterialSettings

Sets the material settings used for shading of the symbol.

setOffset

Sets vertical offset of the symbol (in map units)

setRenderedFacade

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

Static Methods

create

Creates a new QgsPolygon3DSymbol.

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

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 Roofs, 3 for WallsAndRoofs)

Added in version 3.16.

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)

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 Roofs, 3 for WallsAndRoofs)

Added in version 3.16.

Parameters:

side (int)