F_VN_ClosestPointsBF

F_VN_ClosestPointsBF 1:

Find the closest distance between two 2d point sets of the same type, using a brute force approach.

Syntax

Definition:

FUNCTION F_VN_ClosestPointsBF : HRESULT
VAR_INPUT
    ipPointSet1 : ITcVnContainer;
    ipPointSet2 : ITcVnContainer;
END_VAR
VAR_IN_OUT
    fMinDist    : LREAL;
    aPoint1     : TcVnPoint2_LREAL;
    aPoint2     : TcVnPoint2_LREAL;
END_VAR
VAR_INPUT
    hrPrev      : HRESULT;
END_VAR

F_VN_ClosestPointsBF 2: Inputs

Name

Type

Description

ipPointSet1

ITcVnContainer

Container with 1st set of 2d points

ipPointSet2

ITcVnContainer

Container with 2nd set of 2d points

hrPrev

HRESULT

HRESULT indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.)

F_VN_ClosestPointsBF 3: In/Outputs

Name

Type

Description

fMinDist

LREAL

Returns the minimum distance between 2 points of the different point sets

aPoint1

TcVnPoint2_LREAL

Returns the point out of ipPointSet1, for which fMinDist is achieved

aPoint2

TcVnPoint2_LREAL

Returns the point out of ipPointSet2, for which fMinDist is achieved

F_VN_ClosestPointsBF 4: Return value

HRESULT

Weiterführende Informationen

Die Funktion F_VN_ClosestPointsBF bestimmt, welche Punkte aus zwei Punktewolken den geringsten Abstand haben.

Parameter

Punktewolken

In den Punktewolken ipPointSet1 und ipPointSet2 wird nach den nächstgelegenen beiden Punkten gesucht.

Minimale Distanz (Rückgabewert)

Der Parameter fMinDist gibt die Distanz der beiden nächstgelegenen Punkte zurück. Dies entspricht der minimalen Distanz der beiden Punktewolken.

Nächstgelegene Punkte (Rückgabewert)

Die Parameter aPoint1 und aPoint2 geben die zwei nächstgelegenen Punkte aus den beiden Punktwolken zurück.

Anwendung

Das Bestimmen der minimalen Distanz zweier Linien sieht z. B. so aus:

hr := F_VN_ClosestPointsBF(
    ipPointSet1 :=  ipLine1,
    ipPointSet2 :=  ipLine2,
    fMinDist    :=  fDistance,
    aPoint1     :=  aPoint1,
    aPoint2     :=  aPoint2,
    hrPrev      :=  hr
);

Verwandte Funktionen

Required License

TC3 Vision Metrology 2D

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1. 4024.44 or later

PC or CX (x64) with PL50, e.g. Intel 4-core Atom CPU

Tc3_Vision