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

Home » Public Forums » archive » Re: Polygon Smoothing
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 Smoothing [message #70832 is a reply to message #70831] Mon, 10 May 2010 13:03 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <MPG.2651f81de68373869896d4@news.giganews.com>,
David Fanning <news@dfanning.com> wrote:

> Folks,
>
> I have a shape file describing a 2D polygon that is *extremely*
> complex and detailed. For my puposes, overly so. I would like
> to "simplify" or "smooth" this polygon to make it more suitable
> for my purpose (using it as a cookie-cutter for extracting data).
> Has anyone written a polygon smoothing routine, possibly using
> B�zier curves, in IDL to do such a thing? Would you be willing
> to share it?
>
> Thanks,
>
> David

One simple algorithm is to traverse the polygon and remove
points that are nearly collinear. For any three sequential
points you can get the angle at the middle point from the
dot product. If the curvature is less than some threshold,
remove the middle point. You probably want to check the
distance between the points as well as the curvature.

Apply repeatedly until satisfied.

Ken
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Possible to get name of current procedure from within procedure?
Next Topic: decimal numbers

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

Current Time: Sat Oct 11 10:30:56 PDT 2025

Total time taken to generate the page: 0.24163 seconds