PPINPO(3NCARG)

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

πŸ’– PPINPO πŸ’– β€” the NCAR GRAPHICS intersection-polygon bestie

okay so bestie, welcome to PPINPO(3NCARG), aka the NCAR Graphics routine that does the overlap thing. it's from the NCAR GRAPHICS manual and honestly? she's iconic. let's get into it 🫢


✨ NAME ✨

PPINPO β€” generates and returns the boundary of the "intersection" polygon, which consists of all points that are inside both the clip polygon and the subject polygon. πŸ’…

like... the venn-diagram middle bit. the overlap. the "we're both in this" zone. that one. πŸ¦‹


✨ SYNOPSIS ✨

CALL PPINPO (XCCP,YCCP,NCCP,XCSP,YCSP,NCSP,RWRK,IWRK,NWRK,URPP,IERR)

✨ C-BINDING SYNOPSIS ✨

#include <ncarg/ncargC.h>

void c_ppinpo(
     float *xccp,
     float *yccp,
     int nccp,
     float *xcsp,
     float *ycsp,
     int ncsp,
     float *rwrk,
     int *iwrk,
     int nwrk,
     int (*urpp_)( float *xcra, float *ycra, int *ncra),
     int *ierr)

✨ DESCRIPTION ✨

okay so here's every single argument, no skipping, we're doing this properly 🌸

  • XCCP β€” (an input array of type REAL) is the X coordinate array for the clip polygon. that's the scissor, the one doing the cutting βœ‚οΈ
  • YCCP β€” (an input array of type REAL) is the Y coordinate array for the clip polygon.
  • NCCP β€” (an input expression of type INTEGER) is the number of points defining the clip polygon.
  • XCSP β€” (an input array of type REAL) is the X coordinate array for the subject polygon. the one getting clipped, the main character honestly πŸ‘‘
  • YCSP β€” (an input array of type REAL) is the Y coordinate array for the subject polygon.
  • NCSP β€” (an input expression of type INTEGER) is the number of points defining the subject polygon.
  • RWRK β€” (a scratch array, dimensioned NWRK, of type REAL) is a real workspace array. and here's the tea: because of the way in which they are used, RWRK and IWRK may be EQUIVALENCEd β€” and, to save space, they should be. πŸŽ€
  • IWRK β€” (a scratch array, dimensioned NWRK, of type INTEGER) is an integer workspace array. same deal, same tea: because of the way in which they are used, RWRK and IWRK may be EQUIVALENCEd β€” and, to save space, they should be.
  • NWRK β€” (an input expression of type INTEGER) is the length of the workspace array(s). and listen, it is a bit difficult to describe how much space might be required. at the moment, the recommendation is using NWRK equal to about ten times the total of the number of points in the input polygons and the number of intersection points. this situation will change with time; at the very least, the author would like to put in an internal parameter that will tell one how much space was actually used on a given call, but that has not yet been done. πŸ™ˆ (so real of them to admit it honestly)
  • URPP β€” is the name of a user-provided routine to process the polygon-boundary pieces. this name must appear in an EXTERNAL statement in the routine that calls PPINPO, and the routine itself must have the following form:
     SUBROUTINE URPP (XCRA,YCRA,NCRA)
       DIMENSION XCRA(NCRA),YCRA(NCRA)
       ...(code to process a polygon boundary piece)...
       RETURN
     END

each of the arguments XCRA and YCRA is a real array, dimensioned NCRA; the former holds the X coordinates, and the latter the Y coordinates, of a piece of the polygon boundary. and it will be the case that XCRA(NCRA)=XCRA(1) and YCRA(NCRA)=YCRA(1). like yes, it closes the loop, it's giving ✨closed polygon✨ energy. πŸ”₯

  • IERR β€” (an output variable of type INTEGER) is returned with the value zero if no errors occurred in the execution of PPINPO, or with a small positive value if an error did occur. let's break it down, bestie:
    • the value 1 indicates that a degenerate clip polygon was detected.
    • the value 2 indicates that a degenerate subject polygon was detected.
    • the value 3 indicates that the workspace provided was too small.
    • values greater than 3 should be reported to the author, as they indicate some problem with the algorithm. πŸ‘€ not me side-eyeing the algorithm.

currently, if IERR is returned non-zero, one can be sure that no calls to URPP were executed; in the future, this could change, but, in that case, there will be an internal parameter allowing one to request the current behavior. so it's giving for now, iykyk. πŸ’€


✨ C-BINDING DESCRIPTION ✨

the C-binding argument descriptions are the same as the FORTRAN argument descriptions. periodt. no notes. πŸ’…


✨ USAGE ✨

the FORTRAN statement

CALL PPINPO (XCCP,YCCP,NCCP,XCSP,YCSP,NCSP,RWRK,IWRK,NWRK,URPP,IERR)

causes the formation of an intersection polygon (of the clip and subject polygons) and the delivery of that polygon's boundary, piece by piece, to the user-specified polygon-processing routine URPP. like she's handing you the boundary in little gift-wrapped pieces, one at a time 🎁🫢


✨ EXAMPLES ✨

use the ncargex command to see the following relevant examples: ppex01, tppack, c_ppex01. go look at them, they're so good 🌈


✨ ACCESS ✨

to use PPINPO or c_ppinpo, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. order matters bestie, don't freestyle it 😭


✨ SEE ALSO ✨

Online: polypack, ppdipo, ppditr, ppintr, ppplcl, ppppap, ppunpo, ppuntr, ncarg_cbind.

Hardcopy: None. (none. nothing. nada. the vibes are digital only πŸ’€βœ¨)


Copyright (C) 1987-2009
University Corporation for Atmospheric Research
The use of this Software is governed by a License Agreement.

ok that's the whole page, no cap, every flag and every caveat accounted for πŸ’–

and that's a wrap, bestie πŸŽ€ this was PPINPO(3NCARG) from the UNIX manual, source/version vibes straight outta NCAR GRAPHICS, dated March 1995 β€” she's vintage, she's iconic, she still slays πŸŒΈπŸ’…πŸ¦‹

πŸ“¦ where this page comes from