FC_DistancePointFromPlane

 

FC_DistancePointFromPlane - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance of a point from a plane in a 3-dimensional space.

Description

This calculates the distance of the point i_stPoint from the plane i_stPlane. The calculated distance is marked with a sign. The sign states in which of the half spaces defined by the plane i_stPlane the point i_stPoint is located. In addition, the perpendicular of the point onto the plane is calculated.

Interface

Input

Data type

Description

i_stPoint

ST_Vector3D

Point

i_stPlane

ST_Plane

Plane

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

q_lrDistance

LREAL

Calculated distance of the point i_stPoint from the plane i_stPlane.

q_lrParameter1

LREAL

First parameter of the perpendicular q_stPerpendicular in the general parameter representation of the plane i_stPlane (see ST_Plane).

q_lrParameter2

LREAL

Second parameter of the perpendicular q_stPerpendicular in the general parameter representation of the plane i_stPlane (see ST_Plane).

q_stPerpendicular

ST_Vector3D

Perpendicular of the point i_stPoint onto the plane i_stPlane

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionPlane

45

The definition of Plane is not correct.

DefinitionPlane

Enumeration name:

DefinitionPlane

Enumeration value:

45

Description:

The definition of Plane is not correct.

Issue

Cause

Solution

-

At the inputs i_stPlane.stSpanPoint1 and i_stPlane.stBasePoint, the same point has been transferred.

The distance between i_stPlane.stSpanPoint1 and i_stPlane.stBasePoint must be at least Gc_lrZeroTolerance.

-

At the inputs i_stPlane.stSpanPoint2 and i_stPlane.stBasePoint, the same point has been transferred.

The distance between i_stPlane.stSpanPoint2 and i_stPlane.stBasePoint must be at least Gc_lrZeroTolerance.

-

The points i_stPlane.stSpanPoint1, i_stPlane.stSpanPoint2 and i_stPlane.stBasePoint lie on a straight line.

The points i_stPlane.stSpanPoint1, i_stPlane.stSpanPoint2 and i_stPlane.stBasePoint must not lie on a common straight line.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The distance has been calculated successfully.