I moved one vertex in but now I have a kink in my surface.
Is there a clever way to move the second edge so the kink disappears?
A script.
Thought this would be a good little exercise in edit mode bmesh scripting.
import bpy
import bmesh
from bmesh.types import BMEdge
from mathutils.geometry import intersect_point_line
ob = bpy.context.edit_object
me = ob.data
bm = bmesh.from_edit_mesh(me)
edges = bm.select_history[-2:]
verts = set(v for e in edges for v in e.verts)
# ensure the last two selections are both edges that share a vert
assert (
len(verts) == 3
and len(edges) == 2
and all(isinstance(e, BMEdge) for e in edges)
)
# All Ok, the edges
e1, e2 = edges
# The middle vert
v = set(e1.verts).intersection(e2.verts).pop()
# helper method to find closest point on line segment to a given point.
co, d = intersect_point_line(
v.co,
e1.other_vert(v).co,
e2.other_vert(v).co
)
v.co = co
bmesh.update_edit_mesh(me)
other options would be to move middle vert to center (or other defined ratio) of other two, keep the ratio of lengths constant.
To straighten vertices to a line:
Set pivot to 'Active Element'
Select the 2 vertices at the ends, and create a Custom Transform Orientation from them. (The little '+' in the header's Transform Orientation dropdown)
With all 3 vertices selected, and one of the ends selected last, so active, and the new transform orientation active, hit S Shift Y 0, scaling to 0 in all dimensions, except 'Y', the one along the line between the end vertices.