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 theEdgeUseclass. -
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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement