deleting a face on mesh ?

i can list faces with this

for f in myMesh.faces:

  print ('Face s No =',faceno,' f=',f)
  if faceno==5:
       print ('face to be remove=',f)

but then what command can i use to delete one of the face ?


Here its a way to delete faces.

import bpy


obj = bpy.context.object

for f in
    #deselect all faces = False
    #condition to remove face
    if f.index==4: = True

if bpy.context.mode == 'OBJECT':

ok nice way with operators
but i was more interested in the Bpy. type way of doing thing
any idea how it can be done that way ?

folllowing the little example i has given
we can see all the faces but then

is there an equivalent to select the face then erase it in Bpy.type

thanks happy 2.5

Using the bpy its far more complex.

You will have to reproduce the mesh, i mean:
In order to create a face u have to assign at least 3 vertices indexes to faces.vertices collection.
reassigning these indexes to vertices that doesnt exists could work but doesnt remove the face.[0].vertices[0]=200[0].vertices[1]=201[0].vertices[2]=202

Another way its reproducing and replacing the mesh:
In order to do this you will have to get all the vertex information:
Something like
verts = []
for vx in

then reproduce the faces information:
faces = []
for face in
f = []
for i in range(0, len(face.vertices)):

me =
me.from_pydata(verts, [], faces) = me

wait i dont really want to create a new face on an existing mesh
mind you might be interesting to know how to also

but i simply want like adding a cube mesh
then remove the bottom face so i get an open box

so there are no simple way to remove one face with bpy.type command

only simple way is to use bpy.ops!