Hi BStoneArch,
Short Answer:
Note that I changed some of your cylinder dimensions around when I was playing with it - so you might need to change them back to the values you were using.
Long Answer:
I made some assumptions about your use case to simplify the problem down. Might have to adjust if these are incorrect:
- I saw the UVs were already at x2, so I assumed you’d only need half a cylinder.
- Since you’re just cutting along the z axis, I assumed you could manually adjust the vertical coordinates.
First, I looked for the spot on the mesh where the UV coordinates are 0,0. As the U coordinates are scaled up and down, you can spot the seam on the right side of the mesh - the 15 never moves from its spot.
So instead of having 2 rotated cuts…
We’ll have one cut at the seam where the UV coordinates are (0,0)
And then we’ll rotate the second cut to get the angle we want.
From there, we need to figure out how the math of the UVs relates to the angle we want to control.
Looking at a few examples, we can see:
- If UVs are 2, each repeated “slice” is 180 degrees
- If UVs are 3, each repeated “slice” is 120 degrees
- If UVs are 4, each repeated “slice” is 90 degrees.
That relationship is expressed in this formula.
It needs to be massaged a little bit for the specific setup. Here the float value is controlling the red angle, and we want to find the blue angle, so we subtract the red from 180 degrees to get the blue angle. (A good improvement would be to switch to defining the blue angle directly)
Also, since the normals are inverted, we need to add a negative sign back in there, resulting in:
Now just need to isolate the UV_scale, since that’s what we’re trying to find, so we shuffle things around to get:
Which translates to:
We also rotate the second mesh cut. It’s already rotated -90 degrees along the z-axis to get the 180 degree cylinder, so we add that base -90 along with the angle we want to line up with the UV scaling.
Hope this helps, and good luck in your project!