# Selecting Vertices on Symmetry Line of Mirror Modifier

I am trying to extend an existing script that scans meshes for certain conditions, like poles, non-manifold edges and the like.

When a mirror modifier is present on the mesh, all vertices on the symmetry line fall therefore under the conditions non-manifold and 3-valence pole (in case of quad meshes, at any rate).

I want to select the points on that symmetry axis and gather them in an array, to remove them from the other checks' results.

I am uncertain how to best do that, if anybody has suggestions, I would be very grateful for those.

• Edges on the symmetry axis should have only one linked face (generally). So you need these + checking they are on the symmetry plane. – lemon Aug 14 '19 at 8:44
• is there a dedicated operator for that, or do I need to take the origin of the mirror modifier and select verts that lie on that coordinate? – Ben Aug 14 '19 at 8:51
• You'll need to code that. Bmesh to have an easy way to identify edges linked to one face + mathutils.geometry.distance_point_to_plane as the mirror basically corresponds to a plane axis. – lemon Aug 14 '19 at 8:56
• And assuming there is no modifiers previously to the mirror? Is that enough info or do you need more information? – lemon Aug 14 '19 at 9:17
• I am trying to find the necessary parameters and how to get them. – Ben Aug 14 '19 at 9:44

A simple code to retrieve vertices that are on the standard (centered X axis) symmetry plane.

This assumes to be without other modifiers before the mirror.

Principle:

• Get all edges that have only one linked face (border edges)
• Test their distance to the symmetry plane under a limit which should be similar to the merge limit of the mirror modifier

The code:

import bpy
import bmesh
from mathutils import Vector, geometry

obj = bpy.context.object

bm = bmesh.new()
bm.from_mesh( obj.data )

bm.verts.ensure_lookup_table()
bm.edges.ensure_lookup_table()

# If mirrored on self with X axis
center = Vector( (0,0,0) )
axis = Vector( (1,0,0) )

limit = 0.00001

border_verts = set()

for e in [e for e in bm.edges if len(e.link_faces) == 1]:
if geometry.distance_point_to_plane( e.verts[0].co, center, axis ) < limit:
if geometry.distance_point_to_plane( e.verts[1].co, center, axis ) < limit: