PPPLCL(3NCARG)
π PPPLCL π β the NCAR GRAPHICS polyline-clipping girlie
okay so bestie, welcome to PPPLCL, a member of the NCAR Graphics family (that's the 3NCARG section of the manual, if you're keeping track πβ¨).
So what does she do? She clips a polyline against a clipping rectangle. That's it. That's the job. π
And real talk, the devs straight-up say it in the notes: it was intended that eventually there should be a better routine that will clip a polyline against an arbitrary polygon, but that routine has not yet been written. So we work with what we have, and what we have is a rectangle. π
β¨ SYNOPSIS β¨
CALL PPPLCL (XMIN,XMAX,YMIN,YMAX,XCPL,YCPL,NCPL,RWRK,LRWK,URPF,IERR)
π¦ C-BINDING SYNOPSIS π¦
#include <ncarg/ncargC.h>
void c_ppplcl(float xmin,
float xmax,
float ymin,
float ymax,
float *xcpl,
float *ycpl,
int ncpl,
float *rwrk,
int lwrk,
int (*urpf_)(float *xcra,
float *ycra,
int *ncra),
int *ierr)
πΈ DESCRIPTION πΈ
okay let's meet the cast, one by one, no skips π«Ά
XMINβ an input expression of typeREAL, and she's the X coordinate value that defines the position of the left edge of the clipping rectangle.XMAXβ an input expression of typeREAL, the X coordinate value defining the position of the right edge of the clipping rectangle.YMINβ an input expression of typeREAL, the Y coordinate value defining the position of the bottom of the clipping rectangle.YMAXβ an input expression of typeREAL, the Y coordinate value defining the position of the top of the clipping rectangle.XCPLβ an input array of typeREAL, and she's the X coordinate array for the polyline that is to be clipped.YCPLβ an input array of typeREAL, the Y coordinate array for the polyline that is to be clipped. (XCPL and YCPL are a matched set, they ride together π)NCPLβ an input expression of typeINTEGER, the number of points defining the input polyline. In other words: the number of meaningful elements in each of the arraysXCPLandYCPL.RWRKβ a scratch array of typeREAL, a workspace array for PPPLCL to use. It is divided into halves; one half is used for X coordinates and the other half for Y coordinates. This array doesn't have to be too big unless it is important not to break the polyline except at the edges of the clipping rectangle.LRWKβ an input expression of typeINTEGER, the length of the arrayRWRK.URPFβ the name of a user-provided routine to process the fragments of the polyline resulting from the clipping process. This name must appear in anEXTERNALstatement in the routine that calls PPPLCL, and the routine itself must have the following form:
SUBROUTINE URPF (XCRA,YCRA,NCRA)
DIMENSION XCRA(NCRA),YCRA(NCRA)
...(code to process a polyline)...
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 polyline fragment.
IERRβ an output variable of typeINTEGER, returned with the value zero if no errors occurred in the execution of PPPLCL, or with a small positive value if an error did occur. The value 1 indicates thatNCPLis less than or equal to zero, and the value 2 indicates thatLRWKis less than4.
β οΈ girl, watch yourLRWK. If it's less than4, that's an error andIERRwill tell on you (value2). And ifNCPLis<= 0? That's error1. Not dramatic, just facts. π
π§ C-BINDING DESCRIPTION π§
The C-binding argument descriptions are the same as the FORTRAN argument descriptions. Same energy, different language, we love a bilingual icon. π
π USAGE π
The FORTRAN statement
CALL PPPLCL (XMIN,XMAX,YMIN,YMAX,XCPL,YCPL,NCPL,RWRK,LRWK,URPF,IERR)
clips a polyline against a rectangle and delivers the portions of the polyline that fall within the rectangle, one by one, to the user-specified polyline-fragment-processing routine URPF. It's giving personal delivery service, fr fr. π¦β¨
β EXAMPLES β
Use the ncargex command to see the following relevant examples: ppex01, tppack, c_ppex01.
π₯ ACCESS π₯
To use PPPLCL or c_ppplcl, load the NCAR Graphics libraries ncarg, ncarg_gks, and ncarg_c, preferably in that order. (Yes, order matters bestie, don't be chaotic about it. π)
π SEE ALSO π
Online: polypack, ppdipo, ppditr, ppinpo, ppintr, ppppap, ppunpo, ppuntr, ncarg_cbind.
Hardcopy: None.
π 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 crumbs left πβ¨ β this was PPPLCL from the NCAR Graphics manual, as shipped on UNIX, dated March 1995, page PPPLCL(3NCARG). periodt. π
π«Ά
π¦ 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