FC_DistanceTwoLines3D

 

FC_DistanceTwoLines3D - General Information

Overview

Type:

Function

Available as of:

V1.0.3.0

Versions:

Current version

Task

Calculates the distance between two straight lines in the 3-dimensional space.

Description

Calculates the distance between the straight lines i_stLine1 and i_stLine2 in the 3-dimensional space. In addition, the base point of the common perpendicular will be calculated for both straight lines.

Interface

Input

Data type

Description

i_stLine1

ST_Line3D

Straight line 1

i_stLine2

ST_Line3D

Straight line 2

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 between the straight lines i_stLine1 and i_stLine2.

q_lrParameterLine1

LREAL

Parameter of the point q_stPerpendicularLine1 in the general parameter representation of the straight line i_stLine1 (see ST_Line3D).

q_stPerpendicularLine1

ST_Vector3D

Base point of the common perpendicular of the two straight lines on straight line 1

q_lrParameterLine2

LREAL

Parameter of the point q_stPerpendicularLine2 in the general parameter representation of the straight line i_stLine2 (see ST_Line3D).

q_stPerpendicularLine2

ST_Vector3D

Base point of the common perpendicular of the two straight lines on straight line 2

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

DefinitionLine1

32

The definition of Line1 is not correct.

InputParameterInvalid

DefinitionLine2

33

The definition of Line2 is not correct.

DefinitionLine1

Enumeration name:

DefinitionLine1

Enumeration value:

32

Description:

The definition of Line1 is not correct.

Issue

Cause

Solution

-

At the inputs i_stLine1.stPoint1 and i_stLine1.stPoint2, the same point has been transferred.

The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine1 must be at least Gc_lrZeroTolerance.

DefinitionLine2

Enumeration name:

DefinitionLine2

Enumeration value:

33

Description:

The definition of Line2 is not correct.

Issue

Cause

Solution

-

At the inputs i_stLine2.stPoint1 and i_stLine2.stPoint2, the same point has been transferred.

The distance between the points stPoint1 and stPoint2 which define the straight line i_stLine2 must be at least Gc_lrZeroTolerance.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The distance has been calculated successfully.