F_VN_CheckIfPointIsInsideContour
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
Inputs
Name |
Type |
Description |
---|---|---|
ipContour |
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 indicating the result of previous operations (If SUCCEEDED(hrPrev) equals false, no operation is executed.) |
In/Outputs
Name |
Type |
Description |
---|---|---|
aPoint |
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) |
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 |