F_VN_CheckIfPointIsInsideContour

F_VN_CheckIfPointIsInsideContour 1:

Checks if a point is inside a contour (and optionally return the distance to it).

Syntax

Definition:

FUNCTION F_VN_CheckIfPointIsInsideContour : HRESULT
VAR_INPUT
    ipContour        : ITcVnContainer;
END_VAR
VAR_IN_OUT
    aPoint           : TcVnPoint2_REAL;
    fDist            : LREAL;
END_VAR
VAR_INPUT
    bMeasureDistance : BOOL;
    hrPrev           : HRESULT;
END_VAR

F_VN_CheckIfPointIsInsideContour 2: Inputs

Name

Type

Description

ipContour

ITcVnContainer

Single contour (ContainerType_Vector_TcVnPoint2_DINT or ContainerType_Vector_TcVnPoint2_REAL)

bMeasureDistance

BOOL

If true, fDist returns the distance to the nearest contour edge. Otherwise, fDist only returns -1, 0 or +1 (recommended to set to false if the distance is not required, as this is faster).

hrPrev

HRESULT

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

F_VN_CheckIfPointIsInsideContour 3: In/Outputs

Name

Type

Description

aPoint

TcVnPoint2_REAL

Point position to check

fDist

LREAL

Returns the result (> 0: the point is inside the contour; 0: the point is on the contour; < 0: the point is outside the contour)

F_VN_CheckIfPointIsInsideContour 4: Return value

HRESULT

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.54 or later

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

Tc3_Vision