PDA

View Full Version : Help: Finding the vertex order for a polygon in editable mesh


Bumbi
10-10-2005, 01:27 PM
I'm currently building a script to replace faces in one mesh with faces from another mesh. I've worked out how to find and select the source and target faces and vertices. I'm using two editable meshes so that I can use intersectray to pick the faces.

But to get the functionality I want it seems like I need to figure out in what order the vertices have in the polygon since I want to be able to rotate it later on. The problem is that when I try to convert the selection to edges to start going through the edges I get edges outside the polygon I want to use, I also get the hidden edges which makes it a bit more annoying.

Right now it seems like I have to detach the polygon to an element, select all vertices,convert to edges, remove all hidden from the array, and then start looping through it from one vertex until I get back to the start.... Feels like there should be an easier way....

So. How can I get what order the vertices around a polygon have in an effective way? Or does anyone have a better solution to the problem?

Moosley
10-10-2005, 03:30 PM
Hi!

If you can, try converting the objects to Poly, then you can use:
polyop.getFaceVerts <Poly poly> <int face>
which will return an array with the verts in the order that they are on the face.

Bumbi
10-10-2005, 04:37 PM
Yes, I've thought about converting, and it does the job. I just want to know if I'm missing something in meshop so that I can avoid it :)

CGTalk Moderation
10-10-2005, 04:37 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.