CheckIfPointIsInsideContour

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

Syntax

Definition:

HRESULT CheckIfPointIsInsideContour(
    HRESULT          hrPrev,
    ITcVnContainer*  ipContour,
    TcVnPoint2_REAL& aPoint,
    double&          fDist,
    bool             bMeasureDistance
)

Parameters

Name

Type

Description

hrPrev

HRESULT

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

ipContour

ITcVnContainer*

Single contour (ContainerType_Vector_TcVnPoint2_DINT or ContainerType_Vector_TcVnPoint2_REAL)

aPoint

TcVnPoint2_REAL&

Point position to check

fDist

double&

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

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).

CheckIfPointIsInsideContour 1: 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