I’m writing a python script and got stuck in a part of it.

I have a dictionary in wich the KEYs are the vertices and the VALUEs are lists of edges that share the vertices.

I need a function that recursively eliminates the edges (from the VALUEs) with a lower angle to a given plane untill each KEY(vertice) has only one VALUE(edge), and get a list with the eliminated edges.

I have this function to get the angles, but don’t know how to continue from here.

edge_group = verts_dict[key] # get edges of (vert=key)
angles = []
for edge in edge_group:
v1 = Mathutils.Vector(edge.v1.co)
v2 = Mathutils.Vector(edge.v2.co)
vector_u = Mathutils.Vector(v2 - v1)
angle = round (Mathutils.AngleBetweenVecs(face_normal, vector_u))
angles.append(angle)

Can you post more of your script?
For some good examples of this kind of stuff look and Blender 2.42’s BPyMesh.py - I added quite a lot of relational mesh data stuff to that.

My script does not do the same as your’s.
If you know Autocad, it as a trim and an extend functions, and what they do is to cut an edge giving another edge as cut frontier, or extend an edge giving another as frontier.

My script intention is to preform does functions, but in 3D, that’s why i’m using a plane as frontier. If you test it, you see that the extention is not orthogonal, it keeps the edge direction. That’s why i’m using the edges.

The angles test is a choice to help the functionality of the script (aldow both options are possible, i think most people who uses the script go to use it for extend edges more perpendicular “or less paralell” to the plane). I can just say “do not select connected edges”, but i want it more user friendly.