PPPPAP(3NCARG)
π PPPPAP β the polygon glow-up page (NCARG, section 3)
okay bestie, welcome to PPPPAP from the NCAR GRAPHICS manual (section 3, the library-call girlies). this one's a lil preprocessor that gives your polygon a β¨vibe checkβ¨ before it goes off to the trapezoid-making routines. no cap.
β¨ NAME β¨
PPPPAP β can be called to preprocess a polygon in such a way as to remove certain peculiarities that can cause minor cosmetic errors in the output from the routines that return trapezoids. π
π¦ SYNOPSIS π¦
CALL PPPPAP (XCIP,YCIP,NCIP,NBTS)
π C-BINDING SYNOPSIS π
#include <ncarg/ncargC.h>
void c_ppppap(float *xcip, float *ycip, int ncip, int nbts)
πΈ DESCRIPTION πΈ
so here's the tea on every single argument, and yes i'm listing all of them because we do NOT skip:
XCIPβ (an input/output array of typeREAL) this is the X coordinate array for a polygon to be used as input to one of the routinesPPDITR,PPINTR, orPPUNTR.PPPPAPwill alter the contents of this array. she's not just reading, she's editing, periodt.YCIPβ (an input/output array of typeREAL) this is the Y coordinate arrays for a polygon to be used as input to one of the routinesPPDITR,PPINTR, orPPUNTR.PPPPAPwill alter the contents of this array. (yes the original says "arrays" plural, we're keeping it, it's giving mysterious π )NCIPβ (an input/output variable of typeINTEGER) the number of points defining the input polygon.PPPPAPmay reduce the value ofNCIP. she can literally shrink your point count, bestie. iconic.NBTSβ (an input expression of typeINTEGER) the number of significant bits to be left unzeroed in the fractional part of each coordinate. generally, one would probably not want to use a value less than10or12. on a 32-bit machine on which reals have 24-bit fractions,18may be a good choice; on a 64-bit machine with 48-bit fractions, larger values may be desirable. π
π«Ά C-BINDING DESCRIPTION π«Ά
the C-binding argument descriptions are the same as the FORTRAN argument descriptions. literally identical, no notes. π
π₯ USAGE π₯
the FORTRAN statement
CALL PPPPAP (XCIP,YCIP,NCIP,NBTS)
causes preprocessing of the X and Y coordinates of the points defining a polygon which is to be used as input to one of the principal POLYPACK routines that produce trapezoids. the object is to cure an annoying (but basically cosmetic) problem that sometimes occurs.
π the nature of the problem (storytime)
sometimes, when adjacent points have Y coordinates that differ only very slightly, there will be, among the output trapezoids, degenerates, of essentially zero height, that stick out to the left or right from the body of the polygon of which each trapezoid is a part. π«
this happens because, in the calls to the user-defined trapezoid-processing routine URPT, the values of DXLE and DXRE become very large and the difference between the values of YCOT and YCOB becomes very small; in URPT, then, to get the X coordinates at the ends of the top of the trapezoid, the very large values and the very small values are multiplied together and the result is highly inaccurate. it's giving math girlie betrayal fr fr π
β¨ what PPPPAP actually does
what PPPPAP does is this: each of the input coordinates is first modified by zeroing out all but the first NBTS bits of its fractional part; then, any point with the same coordinates as the preceding point is culled. this ensures that there are no adjacent points with X or Y coordinates that are so nearly identical as to cause the observed problem, but has little real effect on the values of the coordinates. slay. π
π why wasn't this done automatically?? (the three reasons, all of them)
there are several reasons why this was not done automatically:
- because it's a little time-consuming (zeroing the low-order bits in a way that doesn't violate the FORTRAN-77 standard is a bit difficult), it shouldn't be done if it doesn't have to be done, and the user may have reason to know that the problem doesn't arise.
- the problem may arise in one of the polygons, but not the other (most likely, in the subject polygon, but not in the clip polygon).
- the user knows best what precision needs to be maintained in the data. π
π EXAMPLES π
use the ncargex command to see the following relevant examples: ppex01, tppack, c_ppex01. go look, they eat every time. β¨
π ACCESS π
to use PPPPAP or c_ppppap, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. don't switch up the order bestie, it's a whole thing. π«Ά
π SEE ALSO π
Online: polypack, ppdipo, ppditr, ppinpo, ppintr, ppplcl, ppunpo, ppuntr, ncarg_cbind.
Hardcopy: None. (nothing on paper, we're digital only in this house π )
π COPYRIGHT π
Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.
real talk:PPPPAPrewrites your arrays in place and can shrinkNCIP, so don't come crying if your input polygon came back different β that's literally the whole job. and please, pick yourNBTSwith intention. π«Ά
okay that's the whole page, no gatekeeping here. this was UNIX flavored, dated March 1995, and filed under PPPPAP(3NCARG) β mwah, drink water, and go preprocess that polygon. π β¨π
π¦ 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