pgxgrid
pgxgrid - compute polygon grid
Usage:
XG := pgXGrid( {pg_stream}PS, {number}IPG, {vector}X, {vector}Y )
Description:
Compute x grid inside polygon (vertical grid lines).
Parameters:
Result:
A matrix (N+1) x 7, N = number of vertical grid lines
row 0: general grid information
XG[0,0]=ixmin minimum x-index
XG[0,1]=ixmax maximum x-index
XG[0,2]=iymin minimum y-index
XG[0,3]=iymax maximum y-index
XG[0,4]=ngrid number of grid points inside polygon
XG[0,5]=clen abs. length of centerline
XG[0,6]=iclen rel. length of centerline
for each verical grid line i (=1..N) the following information is stored:
XG[i,0]=ix x index
XG[i,1]=iy the index of the first y point inside
XG[i,2]=ny the number of y points inside
XG[i,3]=y0 the y value of the enter-point
XG[i,4]=y1 the y value of the leave-point
XG[i,5]=cofs abs. length of centerline from begin to grid line i
XG[i,6]=icofs rel. length of centerline from begin to grid line i
Notes:
The function fails if a vertical gridline intersects the polygon more than twice.