Sign in to follow this  

how to create a graph

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Quote:
Original post by Wizumwalt
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.


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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this