Selecting the local left half
Which half? top, bottom, front, back, left or right... or other..
Here is a test script, run in edit mode, selects the local left half of edit object including those on centre plane.
A plane can be defined by a point in space
plane_co, and its normal
mathutils.geometry.distance_point_to_plane(point, plane_co, plane_no) returns how far a point is from a plane along its normal. Will be negative if on other side to which normal is facing.
The plane coordinate is the centre of the bounding box, the normal is one of the 3 axes made from a corner.
For this example the x axis of bounding box is chosen, to give left - right selection. Choose y for front-back, and z for top-bottom.
from mathutils.geometry import distance_point_to_plane
from mathutils import Vector
context = bpy.context
return (Vector(b) for b in ob.bound_box)
return sum(bbox(ob), Vector()) / 8
bb = list(bbox(ob))
return tuple(bb[i] - bb for i in (4, 3, 1))
ob = context.edit_object
o = bbox_center(ob)
x, y, z = bbox_axes(ob)
print(o, x, y, z)
# select left right
me = ob.data
bm = bmesh.from_edit_mesh(me)
for v in bm.verts:
v.select = distance_point_to_plane(v.co, o, x) >= 0
Test run on Suze