POLYFILLV question [message #19598] |
Fri, 31 March 2000 00:00 |
Daniel Peduzzi
Messages: 29 Registered: June 1999
|
Junior Member |
|
|
I've been trying to use the polyfillv routine to fill a simple rectangle.
After passing in the corner indices of the rectangle, I realized that the
returned 1D indices did not include all the edges in which the corner
indices lie, as illustrated by the sample program below:
;=========================================================
pro polytest
xsize = 10
ysize = 10
; Fill an xsize by ysize array with one's.
a = bytarr(10, 10) + 1
; Make an ROI which takes up the entire array
x = [0, xsize-1, xsize-1, 0, 0] ; x-indices
y = [ysize-1, ysize-1, 0, 0, ysize-1] ; y-indices
ind = polyfillv(x, y, xsize, ysize)
a[ind] = 0
print,a
return
end
;=========================================================
The above program yields the following output:
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1
What I really need is for polyfillv to return the indices of the
outline AND interior points of the rectangle. Is there a way to
coerce pollyfillv into doing this? Or am I doing something wrong?
If not, does somebody have a routine that will return all interior
and edge indices of a polygon?
--------------------------------------------
Dan Peduzzi
peduzzi@mediaone.net
--------------------------------------------
|
|
|