Finding nearby faces

To get all polygons adjacent to the desired one, we can use the “bmesh” module, which provides access to all mesh data in Blender.

First, let’s import the bmesh module, and initialize the interface to the active mesh data using the “from_edit_mesh” method.

The active mesh must be in edit mode.

Get the currently selected face by checking the “select” property of all faces of the mesh:

Let’s define a function that, given a polygon passed to it, returns a list of all polygons that are nearby to it.

We cycle over all the vertices of the face and got all the faces that contain these vertices.

Now we can call our function, pass the currently selected polygon to it, and select all the polygons that will be returned.

To see the resulting selection, apply changes to the mesh data.

Full code:

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comment
Newest
Oldest Most Voted
Inline Feedbacks
View all comments