SFNORM(3NCARG)
β¨ SFNORM β¨ (that's SFNORM(3NCARG) bestie, from the NCAR GRAPHICS manual π)
okay so listen. SFWRLD and SFNORM are the two subroutines you call when you wanna fill in that part of the plotter frame that lives inside a polygonal boundary you drew. that's the whole gig. iconic behavior honestly π
πΈ NAME πΈ
The subroutines SFWRLD and SFNORM are used to fill that portion of the plotter frame inside the area defined by a given polygonal boundary. π
β¨ SYNOPSIS β¨
CALL SFNORM (XRA,YRA,NRA,DST,NST,IND,NND)
CALL SFWRLD (XRA,YRA,NRA,DST,NST,IND,NND)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
void c_sfnorm (float *xra, float *yra, int nra,
float *dst, int nst, int *ind, int nnd)
void c_sfwrld (float *xra, float *yra, int nra,
float *dst, int nst, int *ind, int nnd)
π DESCRIPTION π
okay bestie, here's the whole cast of arguments. every single one. no skips, no skimming, we're doing this properly π«Ά
XRAβ (an input/output array of typeREAL, dimensionedNRA) holds the X coordinates of the points that define the area to be filled. these live in the user coordinate system if you calledSFWRLD, or in the fractional coordinate system if you calledSFNORM. and likeβ¦ heads up: onceSFWRLDreturns, the contents ofXRAwill have been converted to the fractional coordinate system. so it's not the same array you handed in, it changed. main character transformation arc fr π«YRAβ (an input/output array of typeREAL, dimensionedNRA) is the same deal but for the Y coordinates of those points. user coordinate system if it'sSFWRLD, fractional coordinate system if it'sSFNORM. and yep, upon return fromSFWRLD, the contents ofYRAwill have been converted to the fractional coordinate system too. πNRAβ (an input expression of typeINTEGER) is the number of points defining the area to be filled.NRAmust be greater than two. that's the vibe check, don't fail it. three points minimum or we're not doing this πΊDST(NST)β (a scratch array of typeREAL, dimensionedNSTor greater) is for use by the fill algorithm. it's just scratch space, don't get attached, it's not that deep πNSTβ (an input expression of typeINTEGER) is 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. to be sureDSTis large enough, useNIM = NRA; in practice,NIMrarely needs to be that large. for a convex polygon, for example,NIM = 2suffices. so yeah, oversize it if you're nervous, nobody's judging π«ΆINDβ (a scratch array of typeINTEGER, dimensionedNNDor greater) is for use by the fill algorithm. more scratch. also not that deep. β¨NNDβ (an input expression of typeINTEGER) is the length of the arrayIND. it must be greater than or equal toNRA + 2 * NIM, whereNIMis as defined above. note the2 *bestie, that's the sneaky part, don't forget it π
π C-BINDING DESCRIPTION π
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. literally identical. copy-paste energy but in a good way π
π USAGE π
Both SFWRLD and SFNORM fill the area defined by the points (XRA(I),YRA(I)), for I from 1 to NRA. the boundary is made of 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, always, it comes back around π«
The default values of SOFTFILL's internal parameters cause fill to be done with solid, horizontal lines .00125 normalized-device-coordinate units apart. tiny little stripes. obsessed with the precision honestly π
Use SFWRLD if the arrays XRA and YRA contain world coordinates. Use SFNORM if XRA and YRA contain normalized device coordinates. π¦
ok and this is the part where you actually have to pay attention bestie: sinceSFWRLDtransformsXRAandYRAfrom world coordinates to normalized device coordinates, any subsequent calls with those arrays should be toSFNORM(for example, to create a cross-hatched effect). like,SFWRLDalready did the conversion, so callingSFWRLDagain would be double-converting. don't do that. useSFNORM. iykyk π
β EXAMPLES β
Use the ncargex command to see the following relevant examples: ccpscam, cpex01, cpex02, cpex03, sfex01, tsoftf. go look at them, they ate π₯
π§ 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. yes, in that order. the order matters. trust π«Ά
π MESSAGES π
See the softfill man page for a description of all Softfill error messages and/or informational messages. all the lore is over there πΈ
π 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.
and that's the whole page bestie, no cap, every flag and every caveat accounted for π
ok so the boring-but-important sign-off: this was SFNORM(3NCARG) from the UNIX manual, dated March 1993, and it's giving very "NCAR GRAPHICS, vintage edition" energy. slay, bye π¦β¨
π¦ 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