I have a long curve of 425 vertices where there is two round parts :

enter image description here

I would like to unfold this curve to have a straight line where all edges length are the same than the initial curve.

Thanks !

  • $\begingroup$ ...it could work adding an armature of 425 bones, each snapped to move single segments... :D I can't think of any other way... $\endgroup$ – m.ardito Oct 11 '16 at 14:14

I have created a script to do it.
There is probably a native way so I do not accept my own answer.

Here is the script :

import bpy
import bmesh

obj = bpy.context.edit_object
mesh = obj.data
bm = bmesh.from_edit_mesh(mesh)

previous = 0
current = bm.verts[399] #index of one of the two extremity

points = [0]

flag = False
while flag is False:
    flag = True
    for edge in current.link_edges:
        nei = edge.other_vert(current)
        if nei is not previous:
            previous = current
            current = nei
            flag = False
            len = (previous.co-current.co).length

for v in points:

  • $\begingroup$ Nice one. For ends, could look for verts that have only one link edge and put them in a list. [v for v in bm.verts if len(v.link_edges) == 1] Pop one and walk edges till you find the other end, pop the end and repeat till ends list is empty. Could also use BMEdge.calc_length(). $\endgroup$ – batFINGER Nov 8 '17 at 9:22

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.