Hi .Is there any way to find the width,height of each meshes like when the model is unwrapped?I calculated the width and height of mesh by bounding box but it is smaller than when we check unwrap in 3d softwares and 2d Pattern.
I want the opened size of each mesh for example from unwrapped uv.
Wdym by unwrapped mesh? UV is always 1x1.
1 Like
In the most unrestricted situation this is impossible, because one mesh can be unwrapped in many ways. For example, even a simple shape like a cube can be unwrapped into 2x6 or 3x4.
In your case, you may want to calculate as if the unwrapping is done by a tailor. In this case, you may use some heuristics to estimate the size. For example, the unwrapped size might be proportional to the bounding box. For example, the width of an unwrapped front half blouse might be 30% more than the bounding box width (taking into consideration the curvature of the body). You may need to measure several blouses to get a good estimate.
Another approach is to intersect the blouse with a plane to get a series of segments and calculate their length.
A third approach is to use the texture. If the uv coordinates are nicely and uniformly arranged, the texture will be the unwrapped blouse. (PS it is rare to see such arrangements of uv, usually they are shredded and packed to save texture space).
A fourth approach is to use a library that does unfolding. I have no any recommendation, you have to search the net.
A fifth approach is to precalculate the size in some other software and then use these data. I don’t think you will have thousands of different models … maybe a dozen? So, each model, will have some metadata for its unwrapped mesh size. Changing model color, applying decals, etc will not change its size.
A sixth approach is to pick an internal point, cast radial rays, get intersection points and calculate the sum of the distances between the points. The more rays, the better result (but slower). I think 60-100 rays would be sufficient. Here is an illustration:
Good luck with your project.
2 Likes
I mean this. On the left side, I have a 3d model and I use a bounding box to understand width and height. But it is smaller than the main size of an unwraped t-shirt like when we open the t-shirt on the right side. How Can I calculate the true width and height of each mesh?