Not logged in, Join Here! or Log In Below:  
 
News Articles Search    
 

 Home / General Programming / finding the outline of two polygons which share some points Account Manager
 
Archive Notice: This thread is old and no longer active. It is here for reference purposes. This thread was created on an older version of the flipcode forums, before the site closed in 2005. Please keep that in mind as you view this thread, as many of the topics and opinions may be outdated.
 
James Ocliff

April 18, 2005, 08:14 AM

Hi gurus,

Does anyone know the name of an algorithm that can find the outline of two polygons. The polygons are convex or concave (but not with any holes in them), and they share some vertices (as in coordinates).

Like this
****
*----*****
*---*-----*
*--*------*
*--*-----*
*---*----*
*----*---*
********

which should become

****
*----*****
*---------*
*---------*
*--------*
*--------*
*--------*
********

I just need some directions, I don't even know what to google for...

 
Crash

April 18, 2005, 12:34 PM

You could hash all the edges and remove the ones that cause collisions with your hash function.
-M

 
Reedbeta

April 18, 2005, 03:05 PM

Add the edges of the polygons to a list, and then remove all the edges that appear twice (possibly with the vertices in the opposite order each time).

 
James Ocliff

April 19, 2005, 06:42 AM

edit: i misread your posts... will test the edge-approach, thanks for your ideas!

 
This thread contains 4 messages.
 
 
Hosting by Solid Eight Studios, maker of PhotoTangler Collage Maker.