How can I create a selection of all edges parallel to the x-axis using Scripting?
How can I create a selection of all edges parallel to the x-axis using Scripting?
Answers
-
I’m not sure which application you are asking about so I will comment on the general solution.
Loop through all edges and filter out any that are not straight lines. Convert the line into a unit vector and do the dot product of the edge vector to the vector (1,0,0). If you are not worried about flipped orientation take the absolute value of the dot product.
Perfect alignment will have 1 for dot product, but you can set a tolerance like anything above 0.999 is aligned.
Save all the edges that meet criteria to a list, then convert this to an active selection or named selection/group0 -
Hi Mike, I posted this question here to share a script I created, but I think I created it twice by mistake.
How can I withdraw this question?
0