3
$\begingroup$

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.

$\endgroup$
1
  • $\begingroup$ 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. $\endgroup$
    – batFINGER
    Commented Apr 12, 2021 at 18:59

2 Answers 2

1
$\begingroup$

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.

$\endgroup$
2
  • $\begingroup$ 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'. $\endgroup$
    – MartinW2
    Commented Apr 12, 2021 at 20:32
  • $\begingroup$ You are feeling like I was a month or two ago lol $\endgroup$ Commented Apr 12, 2021 at 20:33
5
$\begingroup$

Bmesh script.

enter image description here

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)
$\endgroup$
2
  • $\begingroup$ 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. $\endgroup$
    – MartinW2
    Commented Apr 12, 2021 at 20:36
  • $\begingroup$ 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. $\endgroup$
    – batFINGER
    Commented Apr 13, 2021 at 15:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .