Programmer Guide/Command Reference/EVAL/pgitest: Difference between revisions

From STX Wiki
Jump to navigationJump to search
(initial import)
 
m (1 revision: Initial import)

Revision as of 17:31, 18 November 2010

pgitest - detect point in polygon
Usage:

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {number}XP, {number}YP )

Description:

Detect if a point is inside a simple polygon.

Parameters:
XS
The polygon stream containing the simple polygon, or point list describing the simple polygon.
IX
The index of the polygon describing the simple polygon.
XP
The x point to test.
YP
The y point to test.
Result:

0 if the point <XP,YP> is outside the polygon XS[IX]

1 if the point <XP,YP> is inside the polygon XS[IX]

Usage:

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {vector}XP, {vector}YP )

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {number}XP, {vector}YP )

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {vector}XP, {number}YP )

Description:

Detect if a line is inside a simple polygon.

Parameters:
Result:

A vector I with I[j]=0 if <XP[j],YP[j]> is outside the polygon XS[IX] and

I[j]=1 if <XP[j],YP[j]> is inside the polygon XS[IX]

Usage:

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {number}X1, {number}Y1, {number}X2, number{Y2} )

Description:

Detect if a line is inside a simple polygon.

Parameters:
Result:

0 if all points of the line <X1,Y1>..<X2,Y2> are outside the polygon XS[IX]

1 if all points of the line <X1,Y1>..<X2,Y2> are inside the polygon XS[IX]

2 if the line <X1,Y1>..<X2,Y2> is intersects the polygon XS[IX]

Usage:

I := pgITest( {pg_stream|pg_cplist}XS, {number}IX, {pg_stream|pg_cplist}YS, {number}IY )

Description:

Detect if a simple polygon is inside a simple polygon.

Parameters:
Result:

0 if polygon YS[IX] is outside of polygon XS[IX]

1 if polygon YS[IX] is included in polygon XS[IX]

2 if polygon YS[IX] and XS[IX] are partly overlapping

3 if polygon XS[IX] is included in polygon YS[IX]

pgsplit - split polygon through line
Usage:

YS := pgSplit( {pg_stream}XS, {number}IX, {number}X1, {number}Y1, {number}X2, {number}Y2 )

Description:

Use a line to split a polygon into two polygons.

Result:

The pg_stream YS containing the two polygon parts of the polygon XS[IX]

pgtrans - shift, scale or rotate polygon
Usage:

YS := pgTrans( {pg_stream}XS, {number}IX, {number}DX=0, {number}DY=0, {number}KX=1, {number}KY=1, {number}A=0)

Description:

Shift (dx/dy) / scale (kx/ky) / rotate polygon (a).

Parameters:
XS
The polygon stream containing the simple polygon, or point list describing the simple polygon.
IX
The index of the polygon describing the simple polygon.
DX
DY
KX
KY
A
Result:

The resulting polygon.

Navigation menu

Personal tools