Class: QgsMesh3DSymbol

3D symbol that draws mesh geometry as planar triangles.

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.

Added in version 3.6.

Class Hierarchy

Inheritance diagram of qgis._3d.QgsMesh3DSymbol

Base classes

QgsAbstract3DSymbol

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

class qgis._3d.QgsMesh3DSymbol[source]

Bases: QgsAbstract3DSymbol

__init__()

Constructor for QgsMesh3DSymbol

class RenderingStyle(*values)

Bases: IntEnum

How to render the color of the mesh

Added in version 3.12.

  • SingleColor: Render the mesh with a single color

  • ColorRamp: Render the mesh with a color ramp

  • ColorRamp2DRendering: Render the mesh with the color ramp shader of the 2D rendering

ColorRamp = 1
ColorRamp2DRendering = 2
SingleColor = 0
class ZValueType(*values)

Bases: IntEnum

How to render the Z value of the mesh

Added in version 3.14.

  • VerticesZValue: Use the Z value of the vertices

  • ScalarDatasetZvalue: Use the value from a dataset (for example, water surface value)

ScalarDatasetZvalue = 1
VerticesZValue = 0
addBackFaces(self) bool[source]

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

Return type:

bool

altitudeClamping(self) Qgis.AltitudeClamping[source]

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

Return type:

Qgis.AltitudeClamping

arrowsEnabled(self) bool[source]

Returns if arrows are enabled for 3D rendering

Added in version 3.14.

Return type:

bool

arrowsFixedSize(self) bool[source]

Returns if the arrow size is fixed

Added in version 3.14.

Return type:

bool

arrowsSpacing(self) float[source]

Returns the arrow spacing

Added in version 3.14.

Return type:

float

colorRampShader(self) QgsColorRampShader[source]

Returns the color ramp shader used to render the color

Added in version 3.12.

Return type:

QgsColorRampShader

cullingMode(self) Qgs3DTypes.CullingMode[source]

Returns culling mode

Added in version 3.34.

Return type:

Qgs3DTypes.CullingMode

height(self) float[source]

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

Return type:

float

isEnabled(self) bool[source]

Returns if the 3d rendering is enabled

Added in version 3.14.

Return type:

bool

isVerticalMagnitudeRelative(self) bool[source]

Returns if the vertical component of the mesh is relative to the mesh vertices Z value

Added in version 3.14.

Return type:

bool

levelOfDetailIndex(self) int[source]

Returns the index of the level of detail of the mesh that is the position of the simplified mesh that will be rendered (0 is the original mesh)

See also

QgsMeshSimplificationSettings

Added in version 3.18.

Return type:

int

materialSettings(self) QgsAbstractMaterialSettings | None[source]

Returns material settings used for shading of the symbol

Return type:

Optional[QgsAbstractMaterialSettings]

maximumTextureSize(self) int[source]

Returns the maximum texture size supported by the hardware Used to store the GL_MAX_TEXTURE_SIZE value that comes from the 3D engine before creating the entity

Added in version 3.14.

Return type:

int

renderingStyle(self) QgsMesh3DSymbol.RenderingStyle[source]

Returns the rendering style

Added in version 3.12.

Return type:

QgsMesh3DSymbol.RenderingStyle

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

Parameters:

add (bool)

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

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

Parameters:

altClamping (Qgis.AltitudeClamping)

setArrowsEnabled(self, arrowsEnabled: bool)[source]

Sets if arrows are enabled for 3D rendering

Added in version 3.14.

Parameters:

arrowsEnabled (bool)

setArrowsFixedSize(self, arrowsFixedSize: bool)[source]

Sets if the arrow size is fixed

Added in version 3.14.

Parameters:

arrowsFixedSize (bool)

setArrowsSpacing(self, arrowsSpacing: float)[source]

Sets the arrow spacing

Added in version 3.14.

Parameters:

arrowsSpacing (float)

setColorRampShader(self, colorRampShader: QgsColorRampShader)[source]

Sets the color ramp shader used to render the color

Added in version 3.12.

Parameters:

colorRampShader (QgsColorRampShader)

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

Sets culling mode

Added in version 3.34.

Parameters:

mode (Qgs3DTypes.CullingMode)

setEnabled(self, enabled: bool)[source]

Sets if the 3d rendering is enabled

Added in version 3.14.

Parameters:

enabled (bool)

setHeight(self, height: float)[source]

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

Parameters:

height (float)

setIsVerticalMagnitudeRelative(self, isVerticalMagnitudeRelative: bool)[source]

Sets if the vertical component of the mesh is relative to the mesh vertices Z value

Added in version 3.14.

Parameters:

isVerticalMagnitudeRelative (bool)

setLevelOfDetailIndex(self, lod: int)[source]

Returns the index of the level of detail of the mesh that is the position of the simplified mesh that will be rendered (0 is the original mesh)

See also

QgsMeshSimplificationSettings

Added in version 3.18.

Parameters:

lod (int)

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])

setMaximumTextureSize(self, maximumTextureSize: int)[source]

Sets the maximum texture size supported by the hardware Used to store the GL_MAX_TEXTURE_SIZE value that comes from the 3D engine before creating the entity

Added in version 3.14.

Parameters:

maximumTextureSize (int)

setRenderingStyle(self, textureType: QgsMesh3DSymbol.RenderingStyle)[source]

Sets the rendering style

Added in version 3.12.

Parameters:

textureType (QgsMesh3DSymbol.RenderingStyle)

setSingleMeshColor(self, singleMeshColor: QColor | Qt.GlobalColor)[source]

Sets the single color

Added in version 3.12.

Parameters:

singleMeshColor (Union[QColor, Qt.GlobalColor])

setSmoothedTriangles(self, smoothTriangles: bool)[source]

Sets if the mesh triangles have to been smoothed

Added in version 3.12.

Parameters:

smoothTriangles (bool)

setVerticalDatasetGroupIndex(self, verticalDatasetGroupIndex: int)[source]

Sets the index of the dataset group that will be used to render the vertical component of the 3D mesh geometry

Added in version 3.14.

Parameters:

verticalDatasetGroupIndex (int)

setVerticalScale(self, verticalScale: float)[source]

Sets mesh vertical scale

Added in version 3.12.

Parameters:

verticalScale (float)

setWireframeEnabled(self, wireframeEnabled: bool)[source]

Sets if the mesh wireframe

Added in version 3.12.

Parameters:

wireframeEnabled (bool)

setWireframeLineColor(self, wireframeLineColor: QColor | Qt.GlobalColor)[source]

Sets wireframe line color

Added in version 3.12.

Parameters:

wireframeLineColor (Union[QColor, Qt.GlobalColor])

setWireframeLineWidth(self, wireframeLineWidth: float)[source]

Sets wireframe line width

Added in version 3.12.

Parameters:

wireframeLineWidth (float)

singleMeshColor(self) QColor[source]

Returns the single color

Added in version 3.12.

Return type:

QColor

smoothedTriangles(self) bool[source]

Returns if mesh triangle are smoothed

Added in version 3.12.

Return type:

bool

verticalDatasetGroupIndex(self) int[source]

Returns the index of the dataset group that will be used to render the vertical component of the 3D mesh geometry

Added in version 3.14.

Return type:

int

verticalScale(self) float[source]

Returns mesh vertical scale

Added in version 3.12.

Return type:

float

wireframeEnabled(self) bool[source]

Returns if the mesh wireframe

Added in version 3.12.

Return type:

bool

wireframeLineColor(self) QColor[source]

Returns wireframe line color

Added in version 3.12.

Return type:

QColor

wireframeLineWidth(self) float[source]

Returns wireframe line width

Added in version 3.12.

Return type:

float