View Full Version : mesh importer question

 davegreenwood05 May 2009, 08:42 AMHi all, I wonder if anyone can help me with this. I'm trying to write a mesh importer, that takes data from a plotting type software, and produces poly mesh in maya. There's a couple of areas I'm stuck on, but I'll just ask one question here. The data comes in as edges only, described by vertex a to vertex b. I know that it will produce convex polygons, without holes, so I don't need to check for stuff like that. I'm looking for a good method of walking through the edges to produce faces, and hence face connects, to give whats required for MFnMesh. I can think of a couple of methods, for example checking the angle of the a-b vector with the previous edge, and if they keep turning in the same direction, it's the same face... But, I feel like I might be trying to re-invent the wheel here. Has anyone used a method to turn edges into faces, an existing algorithm perhaps? Any help would be greatly appreciated. Many Thanks. Dave.
dealer2couleurs
06 June 2009, 10:23 PM
I don't know a way to do it but I wonder if you can do particular traitment on your geometry before to read it in Maya.

if you can triangulate it it will be easy to get each faces. you need to find three edges with shared point

if not.... I have to search
maybe you can try in a first time to find triangle face and you will not find a lot, after that you search for square faces (4 edges with 4 vertex value only) after you test for 5, then 6...
each time you have to test all the possible set of edges to find the ones who definie a face. then for each edge set if the number of different vertex is equal to the number of edge you have a face (in my minds)

EVERYTHING I SAY IS JUST THEORIC IDEA. I can't tell if it's a valid solution but maybe it's the best you have for the moment... as you said it's not necessary to re-invent the wheel but even if the one you invent is not a perfect circle it help you to go forward

hope I help

CGTalk Moderation
06 June 2009, 10:23 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.

1