pgxgrid

From STX Wiki
Jump to navigationJump to search

Find all parts of the vertical lines of a grid inside a polygon. The grid is defined by the vectors x (length nx and y (length ny). The function detects all parts of the vertical grid lines <x[i],y[0]>..<x[i],y[ny-1]> (i=0..nx-1), which are inside the polygon p.

Usage
pgxgrid(P, IP, Xvector, Yvector)
P
a closed point-list or a polygon-stream defining one or more polygons.
IP
The index of the polygon of P to be tested; 0 <= IP < pgget(P)
X
The x-scale vector of the grid.
Y
The y-scale vector of the grid.
Result
The result r is a (N+1)x3 matrix, with N is the number of vertical grid lines intersecting the polygon.
content of r[0,*]:
r[0,0] ixmin the X index of the first vertical line intersecting PIP
r[0,1] ixmax the X index of the last vertical line intersecting PIP
r[0,2] iymin the index of the minimum Y value of an intersection line
r[0,3] iymax the index of the maximum Y value of an intersection line
r[0,4] ngrid the accumlated number of grid points inside PIP
r[0,5] aclen the absolute length of the centerline
r[0,6] rclen the relative length of the centerline
content of r[i,*], i=1..N (one row for each intersection line):
r[i,0] the X index of the intersection line
r[i,1] iy[i] the Y index of the first point <X[ix[i]],Y[iy[i]]> inside PIP
r[i,2] iymin the index of the minimum Y value of an intersection line
r[i,3] iymax the index of the maximum Y value of an intersection line
r[i,4] ngrid the accumlated number of grid points inside PIP
r[i,5] aclen the absolute length of the centerline
r[i,6] rclen the relative length of the centerline
See also
pginit, pgget, pgitest, pgiline, pgsplit, pgtrans, pghull


<function list>

Navigation menu

Personal tools