Class: QgsRayCastResult

Contains the results of ray casting operations in a 3D map canvas.

Added in version 4.0.

class qgis._3d.QgsRayCastResult[source]

Bases: object

__init__()

Ctor

__init__(a0: QgsRayCastResult)
Parameters:

a0 (QgsRayCastResult)

addLayerHits(self, layer: QgsMapLayer | None, hits: Iterable[QgsRayCastHit])[source]

Adds all hits from layer to the result

Parameters:
addTerrainHits(self, hits: Iterable[QgsRayCastHit])[source]

Adds all terrain hits to the result

Parameters:

hits (Iterable[QgsRayCastHit])

allHits(self) List[QgsRayCastHit]

Returns all the hits from both layer and terrain intersections

Return type:

List[QgsRayCastHit]

hasLayerHits(self) bool[source]

Returns True is ray hit at least one entity from a layer

Return type:

bool

hasTerrainHits(self) bool[source]

Returns True is the ray intersected the terrain

Return type:

bool

isEmpty(self) bool[source]

Returns True is ray did not intersect any layer or terrain entity

Return type:

bool

layerHits(self, layer: QgsMapLayer | None) List[QgsRayCastHit]

Returns all hits from entities of the specific layer

Parameters:

layer (Optional[QgsMapLayer])

Return type:

List[QgsRayCastHit]

layers(self) List[QgsMapLayer]

Returns pointers to the map layers of entities that were intersected by the ray

Return type:

List[QgsMapLayer]

terrainHits(self) List[QgsRayCastHit]

Returns all terrain intersection hits

Return type:

List[QgsRayCastHit]