SFWRLD(3NCARG)

πŸ’– SFWRLD β€” the NCAR Graphics era πŸ’–

okay bestie, so this is a page from NCAR GRAPHICS, and we're looking at SFWRLD(3NCARG). grab a strawberry drink πŸ“ and let's get into it.


✨ NAME ✨

SFWRLD and SFNORM are the two subroutines that fill in the part of your plotter frame that lives inside a polygonal boundary you hand them. like, you draw the outline, they color inside the lines. very demure, very mindful. πŸŽ€


🌸 SYNOPSIS 🌸

CALL SFWRLD (XRA,YRA,NRA,DST,NST,IND,NND)

CALL SFNORM (XRA,YRA,NRA,DST,NST,IND,NND)

πŸ¦‹ C-BINDING SYNOPSIS πŸ¦‹

#include <ncarg/ncargC.h>

void c_sfwrld (float *xra, float *yra, int nra,
float *dst, int nst, int *ind, int nnd)

void c_sfnorm (float *xra, float *yra, int nra,
float *dst, int nst, int *ind, int nnd)

πŸ‘‘ DESCRIPTION πŸ‘‘

  • XRA β€” an input/output array of type REAL, dimensioned NRA. it holds the X coordinates of the points that define the area you're filling, in the user coordinate system (if you called SFWRLD) or in the fractional coordinate system (if you called SFNORM). and here's the little glow-up: once SFWRLD returns, the contents of XRA have been converted to the fractional coordinate system. she transforms. πŸ’…
  • YRA β€” an input/output array of type REAL, dimensioned NRA. same deal but for the Y coordinates: they're in the user coordinate system (if SFWRLD) or the fractional coordinate system (if SFNORM). and yes, after SFWRLD returns, YRA has also been converted to the fractional coordinate system. twin behavior fr fr. 🫢
  • NRA β€” an input expression of type INTEGER, and it's the number of points defining the area to be filled. NRA must be greater than two. three points minimum, no degenerate little lines, we don't do that here.
  • DST(NST) β€” a scratch array of type REAL, dimensioned NST or greater, for use by the fill algorithm. it's the algorithm's little sandbox, don't worry about it.
  • NST β€” an input expression of type INTEGER, the length of the array DST. it must be greater than or equal to NRA + NIM, where NIM is the largest number of intersection points of any fill line with the boundary lines. and if you wanna be sure DST is big enough, use NIM = NRA β€” in practice, NIM rarely needs to be that large. for a convex polygon, for example, NIM = 2 suffices. lowkey generous of the convex girlies.
  • IND β€” a scratch array of type INTEGER, dimensioned NND or greater, also for use by the fill algorithm. more scratch. more sandbox.
  • NND β€” an input expression of type INTEGER, the length of the array IND. it must be greater than or equal to NRA + 2 * NIM, with NIM defined exactly like above. do the math bestie, don't skip it. 😭

πŸ’œ C-BINDING DESCRIPTION πŸ’œ

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. no notes. iconic consistency. ✨


🌈 USAGE 🌈

so both SFWRLD and SFNORM fill the area defined by the points (XRA(I),YRA(I)), for I from 1 to NRA. the boundary of the area to be filled is made by the lines connecting point 1 to point 2, point 2 to point 3, ..., point NRA-1 to point NRA, and point NRA to point 1. closed loop, no gaps, periodt. πŸ”₯

the default values of SOFTFILL's internal parameters cause the fill to be done with solid, horizontal lines .00125 normalized-device-coordinate units apart. tiny little stripes, very chic.

use SFWRLD if your XRA and YRA arrays contain world coordinates. use SFNORM if XRA and YRA contain normalized device coordinates. and this is the important bit: since SFWRLD transforms XRA and YRA from world coordinates to normalized device coordinates, any subsequent calls with those arrays should be to SFNORM (for example, to create a cross-hatched effect). yes bestie, she changes the coordinates and the vibe, so switch subroutines accordingly. 🧚


πŸ’€ EXAMPLES πŸ’€

use the ncargex command to see the following relevant examples: cmptit, agex12, cpex01, cpex02, cpex03, sfex01, vvex01, tsoftf, fsfwrld.


πŸŽ€ ACCESS πŸŽ€

to use SFWRLD, SFNORM, c_sfwrld, or c_sfnorm, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. in that order.

ok they said it twice so I'm saying it twice too, that's just how it is. πŸ’–

πŸ™ˆ MESSAGES πŸ™ˆ

see the softfill man page for a description of all Softfill error messages and/or informational messages.


⭐ SEE ALSO ⭐

Online: softfill, softfill_params, sfgetc, sfgeti, sfgetp, sfgetr, sfsetc, sfseti, sfsetp, sfsetr, sfsgfa, ncarg_cbind

Hardcopy: 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 bestie, you ate that 🫢 this was the SFWRLD(3NCARG) entry from the UNIX manual, dated March 1993, and I'm obsessed with the fact that a 1993 man page about filling polygons still goes this hard. go fill something. slay. πŸ‘‘πŸ’…βœ¨