plshade

hatch polygon

parametertypeunitsdescription
*xvert,*yvertfloat*uuvertices of the polygon
nvertint--number of vertices
dirfloatdegrdirection of shading lines
wmeshfloatmmdistance between shading lines
linetypeintdashsee plot
returns:void

Description

plshade shades a polygon determined by nvert vertices whose coordinates (in user units) are stored in xvert and yvert. The polygon outline is not drawn: use plpline if you need it. The direction of the shading lines is dir degrees with respect to the current x-axis. The distance between the lines is wmesh millimeters. linetype (see plot) determines the form of the shading lines.

Examples

The following script draws a polygon with plpline and hatches it with solid as well as dashed lines in two directions.
n=20
plrdx n 0  5 10 15 20 25 20 15 10  5  0  -5 -10 -15 -25 -20 -15 -10  -5  0
plrdy n 0  5 10 15 20 25 30 35 40 45 50  45  40  35  30  25  20  15  10  0
plinit PS plshade A4 50 50 "" ""
plshade n 45 2 DOWN
plshade n  0 2 DASH
plpline n "O" DOWN

plshade

Bugs

Concave polygons give unpredictable results when shading lines cross the border more than twice.

See also

simplot program