UV unwrap proportional to "world space"

I am not sure how to best explain what I want to achieve, so I will explain by example

  1. create a default cylinder
  2. calculate the ratio between circumference and height, for the default cylinder this appears to be in the neighbourhood of 3
  3. look at the default uv-map, here the uv island (I am not sure if I am using the term correctly) with all the side faces has an aspect ratio of 2

I want the aspect ratio of the UV map to match the object. (So each rect in the uv map should have the same aspect ratio as the corresponding shape.) I feel like this should be trivial but I have not been successful in my search for a solution. Am I misunderstanding something fundamentally?

For context: I want to use this model in a three.js context and I want to avoid hardcoding anything. So I want to dynamically read the aspect ratio of certain meshes (which I get by material name) to make sure my dynamic textures (HTML canvas) donā€™t stretch. I figured the best way to do this would be to read the UV coordinates, but perhaps thatā€™s not the way to go?

Just load the image into the UV editor first, then unwrap. It should unwrap at the correct aspect ratio.

Hey, thanks for responding. Iā€™m not talking about an image, I mean the aspect ratio of the faces that make up the sides of the cylinder. By extension this means the ratio between circumference and height. (Maybe I am using some incorrect terminology, I hope you know what I mean.)

Oh, I see what you are saying. Sorry, I did not read that carefully. So basically, as if each individual face was projected accurately? That would result in curved UV islands. I am guessing you want them straight and connected?

Yeah, definitely straight and connected. Basically what I want is: If I pick a face from my model and look at it in 2D space, it should look the exact same in UV space (with different scaling of course, but exactly same proportion).

I assume that I am missing some understanding here because I donā€™t see how they could ever be curved unless something went horribly wrong.

because the faces of a sphere arenā€™t perfect squares. the edges get shorter as you move toward the poles.

Maybe I am misunderstanding something, but Iā€™m talking about a cylinder, not a cone or anything like that. The side is divided into rectangles, at least for Blenders default one.

Sorry I really need to read these more carefully. In that case I would just use a cylinder unwrap, then use constrained scaling to match the exact edge lengths between mesh and UVs. S + MMB + directional.

1 Like

So you mean to scale one axis of the relevant UVs until they match? How could I do this in an exact way? Iā€™d rather not just eyeball it.

Thereā€™s a tool that measures edges. It might be in the bundled addons. Anyway, when you go to scale your UVs, notice the little pop-up in the bottom left of your window for numerical entry. You might have to do a little math, but you should be able to match them.

There seems to be an easy way: ā€œAverage Islands Sizeā€ in the UV menu. I am not sure how I missed this for so longā€¦

Thanks a lot for your idea, it got me going in the right direction!

Iā€™m not sure if that will do what you want, but there probably is an easier way that Iā€™m not aware of.

I think what youā€™re trying to say is that you want to make sure that all your various islands are scaled appropriately according to their size on the model, right? If so, that occurs automatically during the unwrap.

Blender will always make sure that every island has the same texel density. You never have to worry about a small space taking up most of your texture real estate relative to a larger space unless you specifically set it that way, which can only be done after that initial unwrap.

1 Like

That, if youā€™re unwrapping the whole object in one go.

I donā€™t normally do it, as most of the times, I want a part to be ā€˜conformalā€™ and another to be an ortho projectionā€¦ And in that case, the AverageIsland scaling is a nice tool to have. :slight_smile:

1 Like

I think that is what I want, yes (I am not entirely sure on the terminology). But this did not occur automatically during the unwrap, so probably I am talking about something subdtly different.

I feel like I canā€™t explain it better than through the minimal example in the original post.

Here you can see that the selected island (the sides of the cylinder) has an aspect ratio of two. But the cylinder actually has a circumference/height ratio closer to 3. Itā€™s not proportional, but I would like it to be.

And (but this is a separate thing IMO, which I donā€™t really care about in this instance, the islands are not properly proportional to each other. Itā€™s not immediately obvious from the picture, but the circlesā€™ diameter is not the same as the height of the rectangles (but the default model has height 2 and diameter 2).

After the average island size thing, the proportions (in both senses) appear to be correct. (I was going to add another screenshot here but it appears that new users can only add one image per post.)

I checked it out myself, and the prepackaged UV layout that comes with the cylinder does have funky scaling. I added some seams, and unwrapped it angle based, and got this is as a resultā€¦

For eyeballing island texel densities/proportions, the UV grid you can generate from an image node is really handy.