comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Polygon hull
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Polygon hull [message #22994 is a reply to message #22993] Mon, 18 December 2000 15:47 Go to previous messageGo to previous message
Mark Hadfield is currently offline  Mark Hadfield
Messages: 783
Registered: May 1995
Senior Member
"Barbara A Cohen" <bcohen@lpl.arizona.edu> wrote in message
news:91jchs$ep4$1@news.ccit.arizona.edu...
> Hi, I have an array of data and I want to plot a polygon that encompasses
> all the points within it. I have tried JHU's convexhull but it fails to
> encompass all the data (example below). Does anyone else have a program
> to do this?

I've just been reading through my brand new copy of David Fanning's "IDL
Programming Techniques 2nd Edition" and I came across the following, in a
discussion of Delaunay triangulation:

"Note that you can return the convex hull of these points with the
TRIANGULATE command too. Simply add a fourth argument to the command...and
the points on the parameter [huh? must be perimeter] of this set of points
will be returned to you."

Here's an example:

x=[0.36,0.35,0.39,0.42,0.60,0.41,0.48,0.73,0.46,0.42,0.42,0. 42,0.47,0.44,0.4
7,0.49,0.54,0.64,0.65]
y=[0.19,0.26,0.26,0.26,0.14,0.22,0.15,0.10,0.16,0.30,0.27,0. 27,0.23,0.23,0.2
2,0.16,0.16,0.08,0.08]

plot, x, y, color=0, /nodata

triangulate, x, y, triangles, b

polyfill, x[b], y[b], color=150, fill_pattern=50

plot, x, y, psym=7, color=0

---
Mark Hadfield
m.hadfield@niwa.cri.nz http://katipo.niwa.cri.nz/~hadfield/
National Institute for Water and Atmospheric Research
PO Box 14-901, Wellington, New Zealand
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: The Book Bidness
Next Topic: Re: Zooming in Object Graphics

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sun Oct 12 00:58:56 PDT 2025

Total time taken to generate the page: 0.00188 seconds