Click here to Skip to main content
15,883,705 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Get a polygons from edges Pin
Member 41945936-Nov-08 7:51
Member 41945936-Nov-08 7:51 
GeneralRe: Get a polygons from edges Pin
73Zeppelin6-Nov-08 8:08
73Zeppelin6-Nov-08 8:08 
GeneralRe: Get a polygons from edges Pin
Member 41945936-Nov-08 8:22
Member 41945936-Nov-08 8:22 
GeneralRe: Get a polygons from edges Pin
73Zeppelin6-Nov-08 8:29
73Zeppelin6-Nov-08 8:29 
GeneralRe: Get a polygons from edges Pin
furqan_sindhu9-Nov-08 19:01
furqan_sindhu9-Nov-08 19:01 
GeneralRe: Get a polygons from edges Pin
Member 419459310-Nov-08 3:08
Member 419459310-Nov-08 3:08 
GeneralRe: Get a polygons from edges Pin
furqan_sindhu9-Nov-08 18:56
furqan_sindhu9-Nov-08 18:56 
AnswerRe: Get a polygons from edges Pin
darrellp28-Nov-08 19:38
darrellp28-Nov-08 19:38 
I think you have some errors in the list of edges. For instance, your polygons include an edge from (2,0) to (2,3) but there is no such edge in your list of edges. Anyway, I think what you're suggesting here is that you've got a list of edges and vertices which define a mesh (often referred to a "boundary representation") and you want to find the polygons in that mesh. I'd suggest that you look at Winged Edge representation, turn your edges into a winged edge rep and get your polys from that. Essentially, you'd have to keep a list of vertices with the edges around them in clockwise order, then traverse each vertex and trace out each poly between adjacent edges. You have to be careful about skipping over polys that have already been listed which means you have to keep track of the polygons each edge separates. It'd be a bit ugly, but I think that's pretty much what's required. It would also mean that the area surrounding the entire mesh will be represented as a "polygon". You can recognize that polygon by looking at the rightmost vertex, getting the first edge from it that is CCW from vertical and the flagging the polygon clockwise from that edge as the "exterior polygon".

If you're looking for a Voronoi diagram that keeps a record of all the polygons, I've got one that I've been thinking about putting up on CodeProject. There's a fortune algorithm already out there on CodeProject, but it has some bugs and pretty much has a dump of edges like you're talking about without an indication of the polygons each edge goes with. Mine gives a full winged edge representation of the diagram which includes all the polygons, edges and vertices with them all hooked together intelligently. If that's what you're looking for, perhaps I'll put my fortune algorithm up earlier rather than later.
QuestionRandom Number Generation Pin
BobInNJ5-Nov-08 13:47
BobInNJ5-Nov-08 13:47 
AnswerRe: Random Number Generation Pin
73Zeppelin5-Nov-08 21:36
73Zeppelin5-Nov-08 21:36 
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 6:29
BobInNJ6-Nov-08 6:29 
GeneralRe: Random Number Generation Pin
73Zeppelin6-Nov-08 8:28
73Zeppelin6-Nov-08 8:28 
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 9:56
BobInNJ6-Nov-08 9:56 
GeneralRe: Random Number Generation Pin
73Zeppelin6-Nov-08 10:21
73Zeppelin6-Nov-08 10:21 
GeneralRe: Random Number Generation Pin
BobInNJ6-Nov-08 12:51
BobInNJ6-Nov-08 12:51 
GeneralRe: Random Number Generation [modified] Pin
73Zeppelin6-Nov-08 20:50
73Zeppelin6-Nov-08 20:50 
QuestionRecords and Clusters [modified] Pin
DQNOK5-Nov-08 4:40
professionalDQNOK5-Nov-08 4:40 
AnswerRe: Records and Clusters Pin
Member 41945935-Nov-08 6:28
Member 41945935-Nov-08 6:28 
GeneralRe: Records and Clusters Pin
DQNOK5-Nov-08 6:56
professionalDQNOK5-Nov-08 6:56 
GeneralRe: Records and Clusters Pin
Member 41945935-Nov-08 7:44
Member 41945935-Nov-08 7:44 
GeneralRe: Records and Clusters Pin
DQNOK6-Nov-08 4:54
professionalDQNOK6-Nov-08 4:54 
GeneralRe: Records and Clusters Pin
Member 41945936-Nov-08 7:57
Member 41945936-Nov-08 7:57 
GeneralRe: Records and Clusters Pin
Member 419459325-Apr-09 4:28
Member 419459325-Apr-09 4:28 
GeneralRe: Records and Clusters Pin
DQNOK27-Apr-09 3:13
professionalDQNOK27-Apr-09 3:13 
GeneralRe: Records and Clusters Pin
DQNOK27-Apr-09 5:57
professionalDQNOK27-Apr-09 5:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.