GFA(3NCARG)
β¨ GFA β¨ β the fill-a-polygon glow-up π
okay bestie, welcome to GFA, a lil routine from the NCAR Graphics crew (that's the 3NCARG manual, bestie, we're fancy) π
. She's the output primitive that fills up polygonal areas β like, you hand her a shape and she colors it in. Very coloring-book, very main character. ποΈβ¨
NAME
GFA β output primitive for filling polygonal areas. That's it, that's her whole job description. π
SYNOPSIS
CALL GFA (N, X, Y)
C-BINDING SYNOPSIS
for my C girlies π«Ά (yes there's a C version, we're inclusive here):
#include <ncarg/gks.h>
void gfill_area(const Gpoint_list *point_list);
DESCRIPTION
here's the tea on the arguments, no cap β:
Nβ (Integer, Input) β how many points are in the polygon you wanna fill.Nmust be greater than two. fr fr, a polygon needs at least three points, you cannot vibe-check a shape with two dots, it's giving line segment πX (N)β (Real Array, Integer) β the X world coordinates of the polygon. the whole squad of them. πY (N)β (Real Array, Integer) β the Y world coordinates of the polygon. matching set, obviously. π
USAGE
so the area that gets 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)). π¦
and then β plot twist β the last point in the polygon gets connected back to the first point with a straight line segment, but only in the case that (X(N), Y(N)) does not equal (X(l), Y(l)). so if you don't close the loop yourself, she'll close it for you. she's thoughtful like that. π
okay but what even IS the "inside" tho π
real talk: if you hand her a polygon whose edges cross each other, it gets ambiguous as to what counts as the "inside" of the polygon. messy. chaotic. the algorithm used in GKS handles it like this:
for a given point, draw a ray starting at that point and going to infinity in any direction. then count the intersections:
- if the number of intersections between the ray and the polygon is odd β the point is within the polygon πΈ
- otherwise β it is outside π
and one lil caveat: if the straight line passes through a polygon vertex tangentially, the intersection count is not affected. noted. π
so if a point is within the polygon, it gets included in the area to be filled. simple as that, periodt. β¨
styles, styles, styles π
several interior styles can be selected β hollow, solid, and various hatch patterns. she contains multitudes. π
for those, go read the man pages for gsfais and gsfasi. iykyk.
note well, bestie, this one MATTERS: by default in GKS, the interior fill style is hollow, or no fill. so if you callGFAand do not get a filled interior as you expected, you will probably need to callGSFAISto set the fill style to something other than"hollow". like. she's not broken, she's just not filled in yet. go tell her what you want. ππ
ACCESS
to use GKS routines, load the NCAR GKS-0A library ncarg_gks. that's the whole vibe check. π₯
SEE ALSO
Online: gsfais, gsfasi, gscr, gsfaci, gqfais, gqfasi, gfill_area
Hardcopy: User's Guide for NCAR GKS-0A Graphics; NCAR Graphics Fundamentals, UNIX Version
COPYRIGHT
Copyright (C) 1987-2009 University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
and that's the whole page, bestie!! π«Άβ¨ this was the GFA(3NCARG) manual, coming at you from the UNIX corner of the world, dated March 1993 β yes she's vintage, yes she still slays, we love a timeless icon ππ mwah, go fill some polygons π
π
π¦ where this page comes from
- debian bookworm: libncarg-dev 6.6.2.dfsg.1-1
- debian trixie: libncarg-dev 6.6.2.dfsg.1-10+b2
- ubuntu jammy: libncarg-dev 6.6.2-10build2
- ubuntu questing: libncarg-dev 6.6.2.dfsg.1-10build2
- ubuntu resolute: libncarg-dev 6.6.2.dfsg.1-12
- ubuntu stonking: libncarg-dev 6.6.2.dfsg.1-12build2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms