Class: QgsRay3D¶
- class qgis.core.QgsRay3D¶
Bases:
sip.wrapper
A representation of a ray in 3D.
A ray is composed of an origin point (the start of the ray) and a direction vector.
New in version 3.18.
QgsRay3D(origin: QVector3D, direction: QVector3D) Constructor
Note
: the direction is automatically normalized
QgsRay3D(
QgsRay3D
)Methods
Returns the angle between the ray and the vector from the ray's origin and the point
point
Returns the direction of the ray see
setDirection()
Checks whether the point is in front of the ray
Returns the origin of the ray
Returns the projection of the point on the ray (which is the closest point of the ray to
point
)Sets the direction of the ray
Sets the origin of the ray
- angleToPoint(self, point: QVector3D) float ¶
Returns the angle between the ray and the vector from the ray’s origin and the point
point
- Parameters:
point (QVector3D) –
- Return type:
float
- direction(self) QVector3D ¶
Returns the direction of the ray see
setDirection()
- Return type:
QVector3D
- isInFront(self, point: QVector3D) bool ¶
Checks whether the point is in front of the ray
- Parameters:
point (QVector3D) –
- Return type:
bool
- origin(self) QVector3D ¶
Returns the origin of the ray
See also
- Return type:
QVector3D
- projectedPoint(self, point: QVector3D) QVector3D ¶
Returns the projection of the point on the ray (which is the closest point of the ray to
point
)- Parameters:
point (QVector3D) –
- Return type:
QVector3D
- setDirection(self, direction: QVector3D)¶
Sets the direction of the ray
Note
: the direction is automatically normalized
See also
- Parameters:
direction (QVector3D) –