Polygon filling erratum [message #27487] |
Wed, 24 October 2001 18:13 |
Mark Hadfield
Messages: 783 Registered: May 1995
|
Senior Member |
|
|
On 4 October I posted a message called "Polygon filling oddities". I
reported that the POLYFILLV and IDLanROI::ComputeMask functions both failed
when the vertices of the filled polygon were negative. If you want the gory
details you can look here...
http://groups.google.com/groups?q=polygon+filling+oddities+g roup:comp.lang.i
dl-pvwave&hl=en&rnum=1&selm=000c01c14c6e%243388e e50%24d938a8c0%40Hadfield
I don't know exactly how to say this, but...I goofed! The test program
included the following code to calculate a mask using POLYFILLV
image = replicate(0B, 500, 500)
p = polyfillv(x, y, 500, 500)
if min(p) gt 0 then image[p] = 255B
tv, image
The "if" test in the third line was meant to test for the case where
POLYFILLV finds no vertices, in which case p is -1. So obviously the line
should be
if min(p) gt -1 then image[p] = 255B
With this fixed, the test program shows that POLYFILLV gives sensible
answers when the polygon vertices are negative. (This despite a statement in
the documentation that says it shouldn't work in this case.)
OTOH, IDLanROI::ComputeMask still fails in the cases I described.
---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield
National Institute for Water and Atmospheric Research
--
Posted from clam.niwa.cri.nz [202.36.29.1]
via Mailgate.ORG Server - http://www.Mailgate.ORG
|
|
|