0
$\begingroup$

I'm trying to make precise models of lab glassware to ISO specs and I've noticed that when I create a UV-sphere and look at it's dimensions, they aren't actually equal. The y and z dimensions are according to the specified radius, but the x dimension isn't so it's slightly compressed in the x dimension. Is this expected behaviour? I figured out that if I set the x dimension after creating the UV-Sphere to my desired diameter, then I get the desired result, but if I set it for all of them, then it becomes an ellipsoid.

I create it using a script, so maybe that has something to do with it?

import bpy

ext = 0.66

bpy.ops.mesh.primitive_uv_sphere_add(segments=res, ring_count=ring_count, radius=ext, enter_editmode=False, align='WORLD', location=(0, 0, ext), scale=(1, 1, 1))
bpy.context.object.dimensions[0] = ext*2

enter image description here

$\endgroup$
4
  • $\begingroup$ what version are you using? it's fine on my side, it's only the z that will vary but that is designed based on the ring count. but the higher the ring count the more it approximates to a perfect sphere. and take note you are adjusting the x with bpy.context.object.dimensions[0] $\endgroup$
    – Harry McKenzie
    Commented Aug 15, 2022 at 2:04
  • $\begingroup$ Usually the Z dimension is the only one which doesn't vary, since the default UV Sphere primitive always has a single vertex at the top and a single vertex at the bottom, regardless of how many segments or rings the sphere has. $\endgroup$ Commented Aug 15, 2022 at 8:07
  • $\begingroup$ oh my bad. it's the x and y that vary when setting the rings. i was singling out z because it was the only one different oops XD $\endgroup$
    – Harry McKenzie
    Commented Aug 15, 2022 at 8:29
  • $\begingroup$ I use blender 3.2 and I create a UV-sphere with rings of 14 vertices with a ring count of 10. The radius is actually misleading in my post, but it's supposed to set a diameter of 66 mm, which I pass as a radius of 33 mm. The line in my code that changes the x-dimension is the part of the code that makes the sphere have equal dimension (so 66 mm on all axes), so it's not actually the code that makes the standard, unequal UV-sphere when you spawn it. $\endgroup$
    – J.Doe
    Commented Aug 15, 2022 at 10:15

1 Answer 1

1
$\begingroup$

I can't see exactly how many segments and rings your sphere has, but the simple answer is, most likely this is caused by the fact that a UV sphere with a not so high polycount cannot have the exact dimensions on all axes depending on how its structure is.

Since a UV sphere is not a perfect sphere, the radius from the center to any of its surface points is usually correct, but edges and faces connecting these vertices are flat. And if the vertices' tangents not fall on the X or Y axis, the dimensions are less than the radius.

In this example I've set a radius of 0.033 m, which should result in dimensions of 0.066 m in X, Y and Z direction if it was a perfect sphere. But since I have set 17 segments and 9 rings, none of the vertices reaches X = 0.033 or Y = 0.033, although their distance from the center is 0.033 m.

sphere radius

In the following image I've made connecting edges between a center vertex and some of the vertices on the surface. As you can see with the Edge Length overlay enabled, all these edges have the correct radius of 0.033 m, though the edges connecting to the flat faces have (as expected) shorter lengths of only 0.0319 m to the left and 0.0325 m to the right. But since they are the farthest extent in Y direction, this results in the overall Y dimension of 0.0644 m.

sphere vertices

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .