Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / Python / Selecting outer or inner faces of mesh with PyMEL?
  RSS 2.0 ATOM  

Selecting outer or inner faces of mesh with PyMEL?
Rate this thread
 
63758
 
Permlink of this thread  
avatar
  • Total Posts: 2
  • Joined: 05 April 2010 07:22 PM

Hi all,

I’m writing a PyMEL script that generates the Menger Sponge with geometry. The script generates a whole bunch of cubes, combines them, merges the verticies then deletes the lamina faces. After i’m left with inner faces that were at the same positions at the lamina faces. 

The only way I can think off to get rid of these faces is to either select all the external faces of a mesh and duplicate them to a new mesh or delete all the internal faces.

Anyone know how to do either?

Thanks,

David.



Attachment Attachment
Attachment Attachment
Replies: 0
avatar

I’ve made some progress…

The snippet below now get’s most lamina and inner faces for deletion. But is extremely slow when working on a mesh with 2400 polys (Menger Sponge iteration 2). Since the mesh is symmetrical I can polySplit it before performing this operation so save some time. Can anyone think of a faster solution?

laminaf pm.polyInfo(lf=True)
    
innerf []
    
for lf in range(0len(laminaf)):
        
verts pm.PyNode(laminaf[lf]).connectedVertices()
        for 
face in mesh[0].f:
            if 
face.connectedVertices() == verts:
                
innerf.append(face)
    
    
output('deleting %i' % (len(laminaf) + len(laminaf)) + ' lamina and inner faces'
    
pm.delete([laminafinnerf])


Replies: 0