# How to delete faces with only one edge connected to mesh?

I think this question must have been asked a thousand times before, but after several attempts to find a solution i am sorry to ask it again: I would like to "delete faces with only one edge connected to another face". Remaining edges and vertices not connected to another face should also be removed.

I can probably rephrase the task to "delete vertices with only two edges connected". I guess that is more or less the same.

Example:

I assume there is a simple sequence of commands to achieve that, but I am simply too blind to find it.

I am aware that after a first iteration in the example above, deleting the face on the right side will result in another face that has only one connected edge. This can be covered in a next iteration, no worries.

• Verts with 2 linked edges could be on a face that with edge links to 2 or more other faces. eg corners of a grid. Apr 12 '21 at 18:59

You can select one of the outermost verts and go to menu Select -> Select Similar -> Amount of Connecting Edges.

Verify the selection, then press X and select Vertices.

• Thanks a lot - this perfectly does the job! I knew it had to be easy... this is how a bloody noob looks like. Anyway: A new world opened up with the idea to use 'similar'. Apr 12 '21 at 20:32
• You are feeling like I was a month or two ago lol Apr 12 '21 at 20:33

Bmesh script.

There may be a way via one of the selection items in the UI, however will propose a script solution

Selecting

Run over all faces in the edit mesh, and if all face edges, or all but one face edge are boundary select the face.

import bpy
import bmesh
from bpy import context

ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
for f in bm.faces:
f.select_set(len([e for e in f.edges if e.is_boundary]) >= len(f.edges) - 1)
bmesh.update_edit_mesh(me)


Deleting

Similarly, while there are faces, find the "tabs", and if any remove their boundary edges, repeat until can find no more, or all faces removed.

import bpy
import bmesh
from bpy import context

ob = context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
while bm.faces:
faces = [f for f in bm.faces if (len([e for e in f.edges if e.is_boundary]) >= len(f.edges) - 1)]
if not faces:
break

edges = list(set(e for f in faces for e in f.edges if e.is_boundary))
bmesh.ops.delete(
bm,
geom=edges,
context='EDGES',
)
bmesh.update_edit_mesh(me)

• Wow, this is a very detailed answer - thank you! I will definitely have a look at Bmesh scripts in Blender at a later point in time (I am capable of programming in general), but for now I prefer the solution provided by @Allen Simpson below for its simplicity. Due to missing reputation my upvote of your answer is not counted right now - will follow up as well. Apr 12 '21 at 20:36
• NP. The second script reminded me of an early "game of life" pascal code. Here's a UV to make you a "citizen" 8*) My avatar is first ever blender model circa 2007 your mesh reminds me of it. Apr 13 '21 at 15:42