1
$\begingroup$

So if I have a list of edges,

selected_edges = [e for e in bm.edges if e.select]

How would I make an array of the vertices contained in the edges of that list?

For context: in my project I'm making a list of shared vertices between two lists of edges.

$\endgroup$
2
$\begingroup$

Use sets.

Will most likely be duplicates in the following vertex list, from any connected edges.

selected_verts = [v for e in bm.edges if e.select for v in e.verts]

Converting to set(...) will have only one member for each vertex.

 set(selected_verts)

or defining as set in first place.

selected_verts = {v for e in bm.edges if e.select for v in e.verts}

The set(...) sounds like the way go as you can check intersection between sets of vertices easily.

between sets.

$\endgroup$

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.