5
$\begingroup$

So I just learned about symmetrize, but don't want to start over on my mesh. Is there a way I can easily select the half I like less, delete it, and then use symmetrize and automerge doubles to have a perfectly even mesh?

$\endgroup$
7
$\begingroup$

Select one vertex in the middle of your model, then press Menu > Select > Side of Active and choose the axis and axis mode in the redo panel:

enter image description here

$\endgroup$
1
$\begingroup$

JuhaW's answer is probably the way to go, but if you don't want to click through all those menus, often a quick border select (B) will do:

enter image description here

$\endgroup$
0
$\begingroup$

I wrote this script so that I could select all vertices that are along the same plane. I needed this because I had a mesh with millions of vertices, but actually describing a simple shape. Instructions:

  • Split the blender pane
  • Change the editor type to text
  • Paste this script
  • Select an object
  • Enter edit mode
  • Select 3 vertices (it will error if not exactly 3 selected)
  • Run the script with alt+p (while mouse is focused on text window)
  • A plane with the given tolerance will be selected

Here is the code:

import bpy
import bmesh
import numpy as np

#################
#
#  Usage
#    Select an object
#    Enter edit mode
#    Select 3 vertices (error if not exactly 3 selected)
#    run the script with alt+p
#    A plane with the given tolerance will be selected
#  
#


# user edit these
tol = 1e-3



def isclose(a, b, rel_tol=1e-09, abs_tol=0.0):
    return abs(a-b) <= max(rel_tol * max(abs(a), abs(b)), abs_tol)

# Setup stuff and unselect everything

obj = bpy.context.active_object

count_sel = 0
selected = []

if 1:
    count_sel = 0
    if obj.mode == 'EDIT':
        print("Object was in edit")
        bm=bmesh.from_edit_mesh(obj.data)
        for v in bm.verts:
            if v.select:
                print(v.co)
                count_sel += 1
                selected.append(v.co)
        if count_sel != 3:
            raise Exception("must select 3 verts")
    else:
        raise Exception("Object is not in edit mode.")

print("---")

p1 = np.array(selected[0])
p2 = np.array(selected[1])
p3 = np.array(selected[2])

# These two vectors are in the plane
v1 = p3 - p1
v2 = p2 - p1

# the cross product is a vector normal to the plane
cp = np.cross(v1, v2)
a, b, c = cp

# This evaluates a * x3 + b * y3 + c * z3 which equals d
d = np.dot(cp, p3)

print('The equation is {0}x + {1}y + {2}z = {3}'.format(a, b, c, d))

def pdist(p, a, b, c, d):
    x = p[0]
    y = p[1]
    z = p[2]

    return np.abs(a*x + b*y + c*z - d) / np.sqrt(a*a + b*b + c*c)


if 1:
    bpy.ops.object.mode_set(mode = 'EDIT') 
    bpy.ops.mesh.select_mode(type="VERT")
    bpy.ops.mesh.select_all(action = 'DESELECT')
    bpy.ops.object.mode_set(mode = 'OBJECT')



if 1:
    for i,v in enumerate(obj.data.vertices):
        pd = pdist(v.co, a, b, c, d)
        # print('p {0},{1},{2} has distance {3} from plane'.format(v.co[0], v.co[1], v.co[2], pd))

        if pd <= tol:
            v.select = True

    bpy.ops.object.mode_set(mode = 'EDIT')

In my use case, after the plane was selected, I click back to the 3d view and press f to join the vertices into a plane.

$\endgroup$
  • 2
    $\begingroup$ This appears to be selecting coplanar verts I believe the OP simply wants to select one half, which for for local x axis mirror would be v.select = v.co.x >= 0 For any plane there is a mathutils distance point to plane method, which will return positive or negative values depending which side of plane. (or 0 on plane) $\endgroup$ – batFINGER Dec 29 '18 at 13:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.