Public Group

how to create a graph

This topic is 4850 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

I need to create a graph for my model so that I can traverse it and find all the unique edges and adjacent faces in my mesh. Right now my mesh is made up of all triangles. I was thinking of using a winged-edge data structure. How do I create this graph or what's it called? Is this a tree or a matrix, or ...? Any help/advice/google words/comments much appreciated.

Share on other sites
Quote:
 Original post by WizumwaltI need to create a graph for my model so that I can traverse it and find all the unique edges and adjacent faces in my mesh. Right now my mesh is made up of all triangles. I was thinking of using a winged-edge data structure. How do I create this graph or what's it called? Is this a tree or a matrix, or ...?Any help/advice/google words/comments much appreciated.

Well, a graph is a graph. It is a specific data structure. you can create one by using two structures (oversimplified pseudocode):

template <class T> struct Node{  list<Link*> links;  T data;};template <class T, class VAL> struct Link{  Node<T> *from;  Node<T> *to;  VAL value;};

You can google for 'graph "data structure"' - it will give you a bunch of links (among them: the boost graph library).

HTH,

Share on other sites
Maybe he means a scene graph?

Mr. Creamy

Share on other sites
No, not a scene graph. I have a mesh of triangles and I'm trying to make a true representation and construct a graph so that I can search it properly for all it's edges. That's my final goal. So I need to find a data structure to build the graph and an algorithm to search it so I can build a unique list of all it's edges.

1. 1
2. 2
3. 3
Rutin
15
4. 4
khawk
14
5. 5
frob
12

• 9
• 11
• 11
• 23
• 12
• Forum Statistics

• Total Topics
633660
• Total Posts
3013221
×