GFA(3NCARG) NCAR GRAPHICS GFA(3NCARG)

# NAME¶

GFA - output primitive for filling polygonal areas.

# SYNOPSIS¶

CALL GFA (N, X, Y)

# C-BINDING SYNOPSIS¶

#include <ncarg/gks.h>

void gfill_area(const Gpoint_list *point_list);

# DESCRIPTION¶

(Integer, Input) - The number of points in the polygon to be filled. N must be greater than two.
(Real Array, Integer) - The X world coordinates of the polygon.
(Real Array, Integer) - The Y world coordinates of the polygon.

# USAGE¶

The area to be filled is delimited by the sequence of straight line segments connecting the successive points (X(1), Y(1)), (X(2), Y(2)), ..., (X(N), Y(N)). The last point in the polygon is connected to the first point with a straight line segment in the case that (X(N), Y(N)) does not equal (X(l), Y(l)).

Given a polygon whose edges cross each other, it becomes ambiguous as to what constitutes the "inside" of the polygon. The algorithm used in GKS is as follows: for a given point, draw a ray starting at that point and going to infinity in any direction; if the number of intersections between the ray and the polygon is odd, the point is within the polygon, otherwise it is outside. If the straight line passes through a polygon vertex tangentially, the intersection count is not affected. If a point is within the polygon, it is included in the area to be filled.

Several interior styles (hollow, solid, and various hatch patterns) can be selected. See the man pages for gsfais and gsfasi for these.

Note well: By default in GKS, the interior fill style is hollow, or no fill. If you call GFA and do not get a filled interior as you expected, you will probably need to call GSFAIS to set the fill style to something other than "hollow".

# ACCESS¶

To use GKS routines, load the NCAR GKS-0A library ncarg_gks.