# Select Doubles?

Hey, is there any way to select all double vertices?

Select them or simply remove them? The latter is a button on the tool (T) menu.

Iâ€™ve been using Blender for about two and a half years and havenâ€™t come across anything that will simply select them all.

If your aim is to get rid of doubled vertices, just select all vertices and hit the â€śRemove Doublesâ€ť button as hinted at by place57. You can adjust how close they need to be to each other to be removed; just look at the bottom of the Tool panel after hitting the button.

The script below will do something like select doubles.
Cautionâ€¦It has a big O of something like N^2. So, itâ€™s miserably slow on large meshes. With a 1,000 or so verts itâ€™s alright. But by the time you get to 5,000 verts it takes a long time (plenty of time to refresh that coffee cup.) Itâ€™s one of those routines that would best be implemented in c.

aljo

``````import bpy
import bmesh
tolerance = 0.001
bm = bmesh.from_edit_mesh(bpy.context.active_object.data)
if(bm.select_mode & {'VERT'}):
for v1 in range(0, len(bm.verts)-1):
for v2 in range(v1+1, len(bm.verts)):
if(abs(bm.verts[v1].co.x - bm.verts[v2].co.x) &lt;= tolerance):
if(abs(bm.verts[v1].co.y - bm.verts[v2].co.y) &lt;= tolerance):
if(abs(bm.verts[v1].co.z - bm.verts[v2].co.z) &lt;= tolerance):
bm.verts[v1].select = True
bm.verts[v2].select = True
bm.free()
bpy.ops.object.mode_set(mode='OBJECT')
bpy.ops.object.mode_set(mode='EDIT')
``````

Just for someone who will be searching this, very quick function

1 Like