POLYGON

Added January 2011

//POLYGON, MODE, BRUSH, X1, Y1, X2, Y2, X3, Y3 {...X10, Y10}

POLYGON draws a polygon based on up to 10 points. Straight lines are drawn between the points using the current pen, including a line from the last point back to the first. The points are specified in the current map mode.

MODE specifies the polygon fill mode:

Mode

Meaning

0

Use existing mode (whatever was last set)

1

("Alternate") Fills in the area between odd and even sides

2

("Winding") Fills in any area with a non-zero "winding value".

 

The difference between the modes is not significant for simple enclosed polygons, but becomes apparent with polygons whose sides cross over themselves. An illustrative example would be a five-pointed star, whose lines intersect to create a pentagon in the middle. The alternate fill mode would fill in the points, whereas the winding fill mode would fill in the entire region.

The winding value is defined as the number of times a pen used to draw the polygon would go around the region.

History

2011 January, A-Shell 6.0.1203:  Added to A-Shell