oh sorry for the confusion, doTest() didn't mean anything it was just
place holder for do some code here.

for x1, x2 in zip( vertList1[:-1:2], vertList1[1::2] ):
    for y1, y2 in zip( vertList2[:-1:2], vertList2[1::2] ):
        if y1 == x2 and y2 == x1:
            print 'match found', x2, x1
            break


Generally it is not very efficient to nest for loops like that. It
gets exponential slower as you add more items to the list.

In the past when I've need to 'walk' my way around mesh I've used
selection commands.

 1. Start with a face
 2. Select the first 2 verts (or edge) of the face
 3. Convert the selection to faces
 4. For each face (that is not our starting face) get the verts used
by the face
 5. When you find a face that uses both of our original verts you have
found the neighbour face.

This should be faster because you don't have to search through all of
the verts every time.

Keir




On May 2, 12:14 pm, Jon Mills <[email protected]> wrote:
> ta guys for your input
> trying to get your code working,
> i dont understand the doTest() bit thou its confusing me lol
>
> ill try to explain what im trying to do in more detail
>
> ive got a shape in this case a sphere,
> and im trying to pair up the faces which are connected together
> this through the x and y verts that make up the face
>
> so ive got pSphere1.f[0]
> and the y vertices for this face are the same as
> the pSphere.f[20]
> x vertices
> so this face is connected
>
> sorry i confused u all by putting x and y when by x i mean the lower
> vertices
> and by y i mean the higher vertices, sorry iv been referring to this code
> this way to myself and thought it was normal lol
>
> by finding out the paired faces i will be able to find out the difference
> between their dot products
> this then finding out the the dot product of the edge they make up
>
> so i need to take vertList1[0] and vertList[1]
> search through vertList2 to find these values
> then search for vertList1[2] and vertList[3]
> and so on....
>
> hopes this helps
>
> --http://groups.google.com/group/python_inside_maya

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to