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 typeREAL, dimensionedNRA. it holds the X coordinates of the points that define the area you're filling, in the user coordinate system (if you calledSFWRLD) or in the fractional coordinate system (if you calledSFNORM). and here's the little glow-up: onceSFWRLDreturns, the contents ofXRAhave been converted to the fractional coordinate system. she transforms. πYRAβ an input/output array of typeREAL, dimensionedNRA. same deal but for the Y coordinates: they're in the user coordinate system (ifSFWRLD) or the fractional coordinate system (ifSFNORM). and yes, afterSFWRLDreturns,YRAhas also been converted to the fractional coordinate system. twin behavior fr fr. π«ΆNRAβ an input expression of typeINTEGER, and it's the number of points defining the area to be filled.NRAmust be greater than two. three points minimum, no degenerate little lines, we don't do that here.DST(NST)β a scratch array of typeREAL, dimensionedNSTor greater, for use by the fill algorithm. it's the algorithm's little sandbox, don't worry about it.NSTβ an input expression of typeINTEGER, the length of the arrayDST. it must be greater than or equal toNRA + NIM, whereNIMis the largest number of intersection points of any fill line with the boundary lines. and if you wanna be sureDSTis big enough, useNIM = NRAβ in practice,NIMrarely needs to be that large. for a convex polygon, for example,NIM = 2suffices. lowkey generous of the convex girlies.INDβ a scratch array of typeINTEGER, dimensionedNNDor greater, also for use by the fill algorithm. more scratch. more sandbox.NNDβ an input expression of typeINTEGER, the length of the arrayIND. it must be greater than or equal toNRA + 2 * NIM, withNIMdefined 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 πΈ
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. ππ
β¨
π¦ where this page comes from
- epel 9: ncl-devel 6.6.2-59.el9 Β· LicenseRef-Callaway-BSD
- fedora 43: ncl-devel 6.6.2-58.fc43 Β· LicenseRef-Callaway-BSD
- fedora 44: ncl-devel 6.6.2-62.fc44 Β· LicenseRef-Callaway-BSD
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms