PPDIPO(3NCARG)
π PPDIPO π
okay bestie, so this is a page from the NCAR GRAPHICS manual β it's PPDIPO, living in section 3NCARG. it's giving computational geometry, it's giving polygon math, and honestly? it's kind of iconic. let's get into it π¦
β¨ NAME β¨
PPDIPO β generates and returns the boundary of the "difference" polygon, which consists of all points that are inside the subject polygon but not inside the clip polygon.
fr fr that's it. subject minus clip. the little "what's left over" region. slay. π
πΈ SYNOPSIS πΈ
CALL PPDIPO (XCCP,YCCP,NCCP,XCSP,YCSP,NCSP,RWRK,IWRK,NWRK,URPP,IERR)
π C-BINDING SYNOPSIS π
#include <ncarg/ncargC.h>
void c_ppdipo(
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 π
XCCPβ (an input array of typeREAL) the X coordinate array for the clip polygon. that's the scissors βοΈ one.YCCPβ (an input array of typeREAL) the Y coordinate array for the clip polygon.NCCPβ (an input expression of typeINTEGER) the number of points defining the clip polygon. so like, how many dots make up the clip shape.XCSPβ (an input array of typeREAL) the X coordinate array for the subject polygon. the main character πYCSPβ (an input array of typeREAL) the Y coordinate array for the subject polygon.NCSPβ (an input expression of typeINTEGER) the number of points defining the subject polygon.RWRKβ (a scratch array, dimensionedNWRK, of typeREAL) a real workspace array. Because of the way in which they are used,RWRKandIWRKmay beEQUIVALENCEd (and, to save space, they should be). π«ΆIWRKβ (a scratch array, dimensionedNWRK, of typeINTEGER) an integer workspace array. Because of the way in which they are used,RWRKandIWRKmay beEQUIVALENCEd (and, to save space, they should be). yes bestie, same sentence, that's just how it is, they're a package deal.NWRKβ (an input expression of typeINTEGER) the length of the workspace array(s). ngl, it is a bit difficult to describe how much space might be required. At the moment, I would recommend usingNWRKequal 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, I would like to put in an internal parameter that will tell one how much space was actually used on a given call, but I have not yet done so. π (author is being so real about it)URPPβ is the name of a user-provided routine to process the polygon-boundary pieces. This name must appear in anEXTERNALstatement in the routine that callsPPDIPOand 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. It will be the case that XCRA(NCRA)=XCRA(1) and YCRA(NCRA)=YCRA(1). (so it closes back up on itself, cute π)
IERRβ (an output variable of typeINTEGER) is returned with the value zero if no errors occurred in the execution ofPPDIPOor with a small positive value if an error did occur. Here's the breakdown, no cap:- the value
1indicates that a degenerate clip polygon was detected - the value
2indicates that a degenerate subject polygon was detected - the value
3indicates that the workspace provided was too small
- the value
values greater than 3 should be reported to the author, as they indicate some problem with 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.
π§ C-BINDING DESCRIPTION π§
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. literally identical bestie, no notes. π
π₯ USAGE π₯
The FORTRAN statement
CALL PPDIPO (XCCP,YCCP,NCCP,XCSP,YCSP,NCSP,RWRK,IWRK,NWRK,URPP,IERR)
causes the formation of a difference polygon (the subject polygon minus the clip polygon) and the delivery of that polygon's boundary, piece by piece, to the user-specified polygon-processing routine URPP. it's giving β¨assembly lineβ¨ but make it geometry.
π EXAMPLES π
Use the ncargex command to see the following relevant examples: ppex01, tppack, c_ppex01. go look, they ate. π
β ACCESS β
To use PPDIPO or c_ppdipo, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (order matters bestie, don't do it wrong π)
π¦ SEE ALSO π¦
- Online:
polypack,ppditr,ppinpo,ppintr,ppplcl,ppppap,ppunpo,ppuntr,ncarg_cbind. - Hardcopy: None. (none. zero. nada. moving on π)
π 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, you're officially a polygon girlie now π this was PPDIPO(3NCARG), from the UNIX manual, dated March 1995 β yeah it's vintage, and it's still serving. go process some boundaries, bestie. mwah π
β¨π
π¦ 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