PDA

View Full Version : tassellating N-Sided polys though MEL


Bob216
08-04-2009, 04:59 PM
HI,
I am having a bit of a problem. When I converted my mesh to Subdivisions, added my creases and other high details, and then converted back to polygons, some of the polys came back in as 5 or 6 sided polys. I first tried quadrangulating the mesh but nothing happened. I then tried cleaning the mesh up by using the mesh->cleanup tool, and ticked on tassellate n-sided polys, but doing so, it did not split the polys continusly through its face path. The last resort I tried doing was to use the split polygon tool, going through and along the rest of the edge rings to the other end. However, this is taking forever to fix.

So now, I have been thinking maybe it would be possible to use split polygon method using MEL. I have some understanding with programming in MEL, and my theory is to have MEL first select all of the n-sided faces. Then loop through each n-sided face and find the edge that is creating the n-sided polygon. Once it finds the edge that is causing the n-sided poly, the script would then find its opposite edge on face and do a ring select base off of that edge. Once the correct edges are selected, I could then have the script do a split poly tool command that would start off from the edge that is creating the n-side poly all the way down to the other end so that it is keeping all the polys in its path as quads.

However, I am not sure how I could create a script that would find the edge who is causing the n-sided poly. Do any of you have any ideas how I can implement this?

cbamber85
08-08-2009, 09:36 AM
it did not split the polys continusly through its face pathfind the edge that is creating the n-sided polygonNot sure what you mean by these statements, this sort of thing is always difficult to describe so post a picture detailing what you're starting with and what result you want.

Bob216
08-09-2009, 08:50 PM
Not sure what you mean by these statements, this sort of thing is always difficult to describe so post a picture detailing what you're starting with and what result you want.
cbamber85 and to all other members,
I am in the process of uploading my images to my website file account right now. I will be posting in detail shortly

Bob216
08-09-2009, 10:01 PM
Okay, I will try my best to explain what I would like to accomplish through words and images. Firstly, when I had converted my sub-d mesh back into polygon mesh, the new converted mesh created n-sided poly's, (a face where it includes more than 4 edges). Here is the result to it....
http://sites.google.com/site/gamedesignersclub/Home/m/convert_subd-to-poly.jpg?attredirects=0

If I try to use Mesh-> quadrangulate, nothing happens, and the mesh stays the same. If I try to use Edit Medh->Insert Edge Loop, it does not split the end faces, who are n-sided size faces. Here is an example of what happens...

http://sites.google.com/site/gamedesignersclub/Home/m/improper_splitting.jpg?attredirects=0

As you can see, the yellow line is the split edges that have been created through Edit Mesh->Insert Edge Loop, but the shaded areas are the faces that have not been splitted. What I am looking for, is a faster way to split the faces so that it corrects the n-sided faces and look like this...

final fig.
http://sites.google.com/site/gamedesignersclub/Home/m/correct_splitting.jpg?attredirects=0


On to my therory to fix this...
I am thinking that could run a script that would first select all of the n-sided poly's and store the selected faces into a string array like so....

polyCleanupArgList 3 { "0","2","0","0","1","0","0","0","0","1e-005","0","1e-005","0","1e-005","0","-1","0" };

sting $facesSelected[] = `filterExpand -sm 34`;

then, here is the part I am having problems with. What I think should fix this, is if the script would evaluate each face one at a time and find the first edge that is causing that piticular face to have an n-sided face. Then, it would need to find the ending edge to where the split ring edges should stop. Oh poo, here is an image that shows the two edges I am refereing to....
http://sites.google.com/site/gamedesignersclub/Home/m/find_edges.jpg?attredirects=0

Once these 2 edges are found, it should be easy enough to find the rest of edge rings that are in between these 2 edges, and then I could run a polySplit command along the edges that the script has found.

if this would work, the end result would look like fig final.

I hope that this clears things up... please let me know either way.

cbamber85
08-13-2009, 08:46 PM
Sorry for the delay, been distracted. Unfortunately none of your pics are loading, so I'm none the wiser.

cbamber85
08-13-2009, 08:51 PM
Duplicate post. Please delete.

CGTalk Moderation
08-13-2009, 08:51 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.