GFA(3NCARG)

πŸ“¦ version 6.6.2, in epel 9, fedora 43, fedora 44

πŸ’– NAME πŸ’–

GFA (aka Fill area) β€” the output primitive that literally fills polygonal areas, no cap. It's giving "color inside the lines" but make it Unix ✨


πŸŽ€ SYNOPSIS πŸŽ€

CALL GFA (N, X, Y)

🌸 C-BINDING SYNOPSIS 🌸

#include <ncarg/gks.h>

void gfill_area(const Gpoint_list *point_list);

✨ DESCRIPTION ✨

  • N (Integer, Input) β€” bestie, this is the number of points in the polygon you wanna fill. Heads up: N must be greater than two. Two points is not a polygon, it's a line, and we don't do that here πŸ’…
  • X (N) (Real Array, Integer) β€” the X world coordinates of the polygon, all N of them.
  • Y (N) (Real Array, Integer) β€” the Y world coordinates of the polygon. Same energy, different axis πŸ¦‹

πŸ”₯ USAGE πŸ”₯

So the area that gets filled? It's 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 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)). Like, if you already closed the loop yourself, she's not gonna double-close it. She's respectful like that 🫢


Now here's the messy part, and honestly it's kind of iconic. When you hand her a polygon whose edges cross each other, it becomes ambiguous as to what actually counts as the "inside" of the polygon. Like, is that a bow or a pretzel? Nobody knows. So 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's outside. Simple. Demure. Mindful.

Oh and if the straight line passes through a polygon vertex tangentially, the intersection count is not affected β€” she's not gonna let a graze ruin the vibe check. And if a point is within the polygon, it is included in the area to be filled. Periodt. πŸ’…


Several interior styles (hollow, solid, and various hatch patterns) can be selected, so you have options, queen πŸ‘‘ See the man pages for gsfais and gsfasi for these.

Note well, and I mean it: By default in GKS, the interior fill style is hollow, or no fill. So 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". Not me spending an hour debugging an empty polygon 😭 It's always GSFAIS. It's literally always GSFAIS.

🧚 ACCESS 🧚

To use GKS routines, load the NCAR GKS-0A library ncarg_gks. That's the whole assignment bestie, go get it ⭐


🌈 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 (C) 1987-2009 University Corporation for Atmospheric Research The use of this Software is governed by a License Agreement.


okay that's the whole page, you ate that πŸ“ this was NCAR Graphics, GFA(3NCARG), straight outta the UNIX manual and dated March 1993 β€” vintage but she still serves ✨ bye bestie, go fill some polygons πŸ’–

πŸ“¦ where this page comes from