Rotate an object so that an edge is aligned with axis

Greetings. I need to rotate an object so that one of its edges aligns with an the x axis. Why is this so hard to do and find answers for? Thankyou for the help!

Also why is it so hard to find the search function on this website to search through posts for a similar one?

Go to edit mode of object (TAB), choose edge that is aligned to x axis, then tap SHIFT+S, choose cursor to selected:

exit edit mode (TAB). From up top menu choose object → Set Origin → Origin to 3d cursor

Now hit R, then X and you have it:

Welcome :tada:..

This is a bit unfair towards the awesome forum search function (top right; :mag:–icon)..

:winking_face_with_tongue:

There are 2 ways without any add-ons I like most.

Let’s say I have rotated geometry(geometry not aligned with object space, so you cannot just set rotation values to 0,0,0) and I want to align this edge to Z axis:

  1. Use snapping:

Create a temporary point to snap to by duplicating the first vert of the edge and moving it in the axis you want to align to with transform operator’s axis constraints( X , Y , Z ), then snap rotation.

Snap1

Make sure the snapping settings are appropriate:

They don’t necessarily have to be this, other combinations work as well, like for example you could use 3d Cursor or any other combination that snaps rotation using the other vert and the one you created temporarily. You just have to know how to use all the snapping system and you can do it any way you want. I am using B hotkey that is for Base point, because I find it convenient. See the docs

  1. Use Align to Transform Orientation:

Create a custom transform orientation out of any mesh elements like the edge and then align objects space(origin) to it, then you can rotate it any way you want further.

AlignToTransformorientation

Edges always have Y axis along their length if you make custom transform orientations out of them, same way faces tend to have Y aligned to the longer dimension and Z axis is pointing away from the surface(normal diraction). You might need to think more about how to rotate the object correctly, so I preffer the first method because it’s more visual and straight forward.

I am sure there are other ways and plenty of add-ons that can help deal with this as well.

Don’t forget to delete the temporary vert or the custom transform orientation afterwards.

Andreal’s method is also really awesome. I tend to use snapping not because it’s better for this in any way, but because it’s sort of a bit more universal for other situations if you need to align only parts of the mesh, or you need to align with other geometry… It just works for more than this and I am used to it.

I can’t understand what i am doing wrong here, i created a vertex, set it to snap to vertex active, try to rotate it, and this side still wont align with the axis. I am looking from Z view. I need the far right side aligned with the axis so its face is straight up and down from this perspective.

w.

Snapping and transform functionality in Blender has loads of features so it might be a bit confusing to get used to it.

The Snap Base setting are irrelevant if you are using B hotkey while snapping since you then specify the snap base manually

Transform pivot point is important in this case as well as vertex snapping and rotation snapping enabled. They don’t need to be what I show necessarily as long as you are using the transforms and snapping correctly - for example 3d cursor snapped to the vert you need to rotate around and the other one selected last as active would also work if snap base is set to active and transform pivot to 3d cursor.