# Transforming UV through Geometrying Nodes

I'm trying out the UV Unwrap node, and I've got it working - but the orientation of the UV is unpredictable, so I'm hoping there's a way to transform it to the direction/scale that I want.

In the image below - you can see that a value for the X scale of 3.3 has the UV aligned one way, but a value of 3.4 has the UV aligned the other way. I want to make sure that the alignment is consistent.

Any suggestions?

• You could read a value from the UV, calculate an angle based on it, and reverse rotation of that angle. This will work to align a particular part of the unwrap, but it doesn't guarantee the UV stays aligned in general: it's not a numerically stable process and can bifurcate. Commented Dec 9, 2022 at 11:52
• Just checking: Does the answer below help you, or do you still have questions about it? Commented Jan 19, 2023 at 11:43
• I haven't had the opportunity to incorporate this into my project, but it appears to work well.
– G.H.
Commented Jan 31, 2023 at 1:03

In this particular case, you don't actually need to use the UV Unwrap node.

Instead, it is actually sufficient to put the UVs together yourself:

The procedure here is as follows:

1. Create a Bounding Box from your mesh.

2. Separate Min and Max and get the lowest and highest values for the X- and Y-axis respectively, so that you get a constant aspect ratio of these two axes.

3. Then use Map Range and map the positions into the range $$(0,0,0)$$ and $$(1,1,1)$$.

4. Finally, use Vector Rotate to rotate your UVs around the Z-axis and align them exactly the way you want.

This way you can use any scaling and also align the UVs individually, and the size always adjusts to the longest side.

(Blender 3.2+)