Switch direction of edge?
-
Is there any way to switch the start and end of an edge? I noticed that many times, loops don't go start to end/start of next line(see examples):
It also seems to mess up with Loop.convex?().
-
I suggest you look into Weld.rb and several other tools that use similar code to order the vertices in a loop - it's a bit convoluted but 'order_points' is a vital part many scripts...
-
Copy 180° rotate it then kill the original?
-
Yeah, its not possible through the API. Instead you have to figure out the order on your own and track them in a an array or set or hash or something.
-
As Chris, I write my own routines into the script to sort the edges/vertices..
Edge.reversed_in?
is useful, as well is theEdgeUse
class. -
IF the edges are coplanar and they either bound a face or can be given a face, then you can get the face.vertices and these always return ordered and in the same direct relative to the face.normal - counterclockwise if my memory serves we well...
You can then use these vertices to get an array of ordered points to redo a set of edges so they are all the same direction... I've been thinking of a quick fix where you clone the face.edges into a group from this etc...
You need to delete the old edges and remake the face etc
It could be a quick way to make curves too...
For 3D edge collections it's a slog through the edges and sorting them as Chris says - I believe that it was RickW who was the first to come up with a method for this - as seen in weld.rb ... -
TIG's method of getting the vertices of a face worked for me.
Thanks everyone for the replies.
Advertisement