F_VN_RotatedRectangleCorners

F_VN_RotatedRectangleCorners 1:

Computes the 4 corner points of a rotated rectangle.

Syntax

Definition:

FUNCTION F_VN_RotatedRectangleCorners : HRESULT
VAR_IN_OUT
    stRect   : TcVnRotatedRectangle;
    aCorners : TcVnArray4_Point2_REAL;
END_VAR
VAR_INPUT
    hrPrev   : HRESULT;
END_VAR

F_VN_RotatedRectangleCorners 2: Inputs

Name

Type

Description

hrPrev

HRESULT

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

F_VN_RotatedRectangleCorners 3: In/Outputs

Name

Type

Description

stRect

TcVnRotatedRectangle

Rotated rectangle

aCorners

TcVnArray4_Point2_REAL

Returns the 4 corner points

F_VN_RotatedRectangleCorners 4: Return value

HRESULT

Further information

The function returns the four corners aCorners of the rotated rectangle as TcVnArray4_Point2_REAL, which corresponds to an Array [0..3] of TcVnPoint2_REAL . At an angle of 0°, aCorners[0] contains the coordinates of the lower left corner of the rectangle parallel to the axes. The remaining indices follow a clockwise order from the top left (aCorners[1]), top right (aCorners[2]), to the bottom right (aCorners[3]). If the rectangle is rotated by 165°, for example, the corner assignment rotates accordingly so that the original bottom left corner is now at the top right.

F_VN_RotatedRectangleCorners 5:

Required License

TC3 Vision Base

System Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT V3.1.4024.59 or later

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

Tc3_Vision