Achieve variable distance edge flow between vertices

He guys :slight_smile:

Is that possible to automatically make an edge (or edit existing one) between 2 vertices with achieving variable radius flow.
I dunno how to explain this, so just make an image.
So, as you can see, desired result are new edge (or existing one) which creates new vertices (or change position of existing one) while constantly and linearly decreasing.

I know about connect vertex patch. It will not provide desired result by default for complicated shapes.

Just a little update:

The only way which i found is making a pretty dense loop cut, and just welding vertices which will forming those linear shift of the edge. But its clumsy and in complicated and dense meshes it will require too much of monkey-work

I am not sure if I am misunderstanding your question, the knife tool should work for you.

To modify the existing (red) loop; Press k (knife tool) and snap to the first and last vertex you want the loop to line up to. The knife tool will snap automatically you do not need to turn snap on, do not click on the middle edges as it could «wobble» your loop.

To make a new loop; do the same clicking wherever you want on the first and last edge. Again without clicking on the middle ones.

Its not a solution. Knife tool ignore topology at all. While i need a way to keep new created edge topology dependence.

Thats a knife tool.
Blue line is what i try to achieve.
And why not cut the blue path by hand? Because i deal with complex geometry and it will not only takend too much time, it may and will ruin precise edge flows important to achieving goot curvature of the surfaces.

Ok, that is a totally different example, I would place a vertex in position A and another in B (by subdividing the edges) then do a loop cut in the middle faces and finally use j to join the ends of the loop cut to the vertex. Note that in your second example you create a triangle and an Ngon on the right hand side which would need fixing. The result would be something like this:
lc

If you want the loop cut to be placed exactly how you have drawn the line, “variable radius flow”?
I do not think you can «automatically» in this situation.

Norman i know how to use loopcuts. In you image you just create an edge which divide perpendicular edges by 2.
Its not what im try to achieve.
I need a cut where position of edge vertices will slightly change over time (over cutted edges) and iteratively get closer and closer from vertex A to vertex B.

In you cut look at greet line. Look at perpendicular edges. They all have same length.
While i need them to be vary along the cutting path.
In my image i marged some of the “perpendicular” edges as purple for clearly descripe which edges exactly im calling “perpendicular”.

I think that is not possible, sorry I can not help.

Ok, using the loop tools add-on try doing the loop cut then select the loop and use “loop tools” -relax. Not exact spacing as you want but sort of helps.


Loop tools - relax

Thanks but unfortunately loottools wouldnt help. Any options to relax edges will cause heavily surface/topology degormation.
It kind of works for planar geometry, but not for more complicated forms.

Maybe machinetools can do that job but im not sure.

Yes sorry, I think that what you want is not possible, or I do not know the solution :slight_smile:

I have found one way to do this with face-gridfill. Grid fill does have limitations and will not work in all situations, but it does do an «incrementally even» cut. That indicates that it should be possible to make an addon that does this more efficiently (I do not have the knowledge to do it myself), nor do I know if there is an existing addon that already does this.


I added the vertexes A and B then deleted the faces and used grid fill to make the result.

This looks like what you are after.

Hey thanks! Im absolutely forgot about grid-fill at all. It looks like at least as possible temporary solution. But generally edge behave like i want.

And yeah, looks like it have some limits and also can behave a bit wierd :slight_smile:

Here’s unscaled default cylinder. I add 2 vertices on the opposite edges and make grid-fill. One by one for 2 sides.
In one side it would be linear and surface will be round. In other side line would be kind of exponential and surface would bend outwards.

I try keep different edges as active selected before grid-fill. Im also try to retriangulate mesh and turn triangles edges differently, but with no luck.
I gress it may relay on vertex index or some other data of the mesh.

Anyway, thanks again for helping :slight_smile:

Yes I have seen that behavior in some tests, maybe it has to do with the order in which you select the edges to be filled (just a thought I have not experimented that)
Edit: I see you may have already tried this

I have found a way to do the “b” side of the cylinder example. select the whole mesh and in the mesh menu there is an option “sort elements”. choose “reverse” and reverse edges (for me reverse edges was the default value). Then you can do select boundary edges, do the grid fill and now the B side also looks good!
:slight_smile:
Edit: you do not have to select the whole mesh It also works if you reverse only the edge loop you want to Grid Fill.

@SoundDifferent I saw your post on Polycount. Don’t know if you’re still looking for a solution to this as it’s been a long time.

With the basis shape of the mesh as one extreme (Xn), you can have a shape key that moves all vertices to the other extreme, all together.
So all vertices that will move start at Xn, and the shape key puts them all at X1 (you can do this by using Vertex Slide to move them all together).
Then use a vertex group with weights created by script to be perfectly linear (as much as numerical precision will let you, at least), and use that group as the blending for that shape key.

(This is an animated GIF, click in case it doesn’t play)

The script I wrote for this is below. Before running it, you need to select a vertex sequence, and then use Shift+Click to unselect and reselect the first vertex, as the first vertex of the sequence needs to be the active one. You also need to make sure that there’s a vertex group in the object named “X1Blend”, but you can change its name in the script of course:

import bpy
import bmesh

obj = bpy.context.active_object

VERTEX_GROUP_NAME = 'X1Blend'
VERTEX_GROUP_INDEX = obj.vertex_groups.find(VERTEX_GROUP_NAME)
if VERTEX_GROUP_INDEX == -1:
    raise Exception('Group not found, check if the name is right')

mesh = bpy.context.active_object.data
bm = bmesh.from_edit_mesh(mesh)

# Traverse the selected vertices, assigning linear weights.

deformLayer = bm.verts.layers.deform.active
visited = set()
TOTAL_SELECTED_VERTICES = len([v for v in bm.verts if v.select])

currentVertex = bm.select_history.active # Start from the active element (assumed to be a vertex).
currentIndex = 0

while currentVertex:
    # Add the current vertex to visited set.
    visited.add(currentVertex)
    
    # Set its weight.
    # A linear formula for interpolating the weight can be (vertex_index / (total_vertices-1)),
    # with 'vertex_index' being a zero-based index. 
    # If there are 3 selected vertices, their weights will be: 0.0, 0.5, 1.0.
    # If there are 5 selected vertices, their weights will be: 0.0, 0.25, 0.5, 0.75, 1.0.
    # And so on.
    weight = currentIndex / (TOTAL_SELECTED_VERTICES - 1)
    currentVertex[deformLayer][VERTEX_GROUP_INDEX] = weight
    currentIndex += 1
    
    # Reference the next vertex, if there is one.
    currentVertex = next(
        (
            linkedEdge.other_vert(currentVertex)
            for linkedEdge in currentVertex.link_edges
            if linkedEdge.select and linkedEdge.other_vert(currentVertex) not in visited
        ),
        None # Will default to None if the next vertex can't be found (like after the last one).
    )
1 Like

Hey, thank you :slight_smile: I will try that solution.
Currently im using some planes with subdiv and swrinkwrap for manipulating big amount of vertices where need to maintain smotth and accurate edges flow.