3
$\begingroup$

On the left is a quad sphere which is the result of subdividing a cube, and using Alt+Shift+S to turn it into a sphere. On the right is my desired quad sphere, where I have painstakingly evened out the edges, so that all edges in the same edge loop are of the same length. What is the best/easiest/fastest way to create this kind of quad sphere?

enter image description here

My current method, which is rather tedious, looks like this:

I take one quadrant of one side of the original cube: enter image description here

Then I alternate selecting all of the vertical and horizontal edge loops, and Looptools > Space them: enter image description here

Finally, I duplicate and rotate this section of the sphere as necessary: enter image description here

Is there a significantly more efficient way to achieve the same result?

This is a demonstration of the type of quadsphere I am attempting to achieve:

$\endgroup$
7
  • 2
    $\begingroup$ Sorry, but are you sure what you're wanting is even possible? Seems to me that any method is going to give you an approximation. Isn't this somewhat related to the problem of projecting a map of the globe with limited distortion? en.wikipedia.org/wiki/List_of_map_projections $\endgroup$ Commented Feb 8, 2022 at 21:57
  • 1
    $\begingroup$ Yes, I am sure what I want is possible, because I have already created it. I'm just looking for a quicker way to do so. My ideal quadsphere still has distortion, but the key is that all edges in the same edge loop are of the same length. I added a demo blend file to the question. $\endgroup$
    – Rekov
    Commented Feb 9, 2022 at 22:08
  • 1
    $\begingroup$ What interests me, since you've already done this, and show this on the GIF, why do you need help with this? Isn't the fastest way to generate more such meshes to just save this one and duplicate or append in other projects? Do you ask because you want to learn modelling techniques or because your technique somehow doesn't work on more subdivided sphere or something like that? Also, your technique ends up with the sphere being less spherical, i.e. if you cast it to sphere, it will move some vertices (and again produce non-equal line lengths). This brings us back to Allen's question. $\endgroup$ Commented Feb 10, 2022 at 0:10
  • $\begingroup$ You can get both equal length edges and a perfect sphere by repeatedly alternating cast to sphere and looptools space. You converge on the perfect result. It is a tedious and time-consuming process. I made the initial post because I was hoping for a quicker method. I obviously re-use the quadspheres from my file, and each time I need one with different amounts of segments I add it to the file as I make it. Just looking for a quicker way, as I said. But this works for now. $\endgroup$
    – Rekov
    Commented Jun 6 at 23:48
  • $\begingroup$ @Rekov you can automatize it in geonodes, but the problem is there's no simple way to get loop ID (to group edges by loops). Could be programmed in, not very hard, but would take a few hours, more than I'm willing to spend on it currently, given a few months ago already, mod nop has implemented it in C++ and waits for it to be merged into Blender main branch... Hmm, actually you can given you start with a cube... $\endgroup$ Commented Jun 7 at 10:07

3 Answers 3

7
$\begingroup$

The Extra Objects addon can create a quadsphere with even edges
Just enable it in Preferences > Addons

enter image description here

$\endgroup$
1
  • $\begingroup$ That quadsphere also doesn't have even edges, but it's certainly a much better result than the cube + alt shift s method. $\endgroup$
    – Rekov
    Commented Feb 8, 2022 at 19:34
2
$\begingroup$

A Geometry nodes modifier will produce an evenly spaced quad sphere and allow you to set up a template with your own options and input any quad count. Constructed with arcs, the spacing is perfect for the lines going one direction but not the other. The step labeled "Make Symmetrical" is only necessary if you want 90° symmetry using a compromise best fit for the spacing running both directions.

You can download this .blend file and use Append to add a Quadsphere or the Modifier itself into your file. Append the Modifier itself from the Node Tree folder, or an example quadsphere from the object folder. Change the number of steps in the geometry nodes modifier.

enter image description here Quad Sphere Geometry Nodes

$\endgroup$
2
  • $\begingroup$ I'd try a simulation to repeatedly move vertices away from too small faces towards too big faces and try to approach the local minimum this way. $\endgroup$ Commented Aug 30 at 8:21
  • $\begingroup$ @MarkusvonBroady , actually I have experimented with a simulation, but my approach creates a kind of bias that is farther off than the solution I have. I'm not skilled enough in math to get the algorithm right. $\endgroup$ Commented Aug 31 at 3:50
1
$\begingroup$

I ended up here after realizing a cylinder extruded from the cross-section of a quad sphere made with the Extra Objects addon does not have equal sides. I was dismayed. DISMAYED.

Here is a comparison of it to a normal circle (orange):

quad sphere by Extra Objects addon

The ideal you are asking for appears to be possible. While I have no formal proof in favor or against, your samples have a lot going for them, and can be approximated with code.

Looking at add_mesh_round_cube.py of the Extra Objects addon, one can see that its idea of a quad sphere is a specific parameterization of a more general mathematical formalism. Apparently not one designed to get equal edge lengths.

To find the math which would do the job, I studied your sample quad spheres for a bit. One thing I thought is noteworthy is that the ring segments on each of the 6 "sides" each appear to have their vertices within a plane, just as other quad spheres do. (There is a bit of inaccuracy in the samples, which I am not sure whether it is safe to ignore.) From there, we can construct the three axis-aligned circles as well as the twelve 45°-angled circle segments, using some known math to determine the angle between (1, 1, -1) and (1, 1, 1) as well as rotate vertices around an axis.

To get the positions of the remaining vertices, it is important to notice that the circle segments between the axis-aligned circle segments and the 45°-angled circle segments have a smaller radius than 1. This is because the plane in which they lie demonstrably does not intersect the center of the quad sphere. While there is nothing unusual about this (given other quad spheres), we need to know the exact radii to figure out the angle spanned by each circle segment. To do this we can use two opposing points p0 and p1 of two 45°-angled circle segments of one "side" of the quad sphere as well as the center point halfway in between pCenter. This gives us a vector with the correct direction of the center of the circle segment's arc as w = pCenter - 0.5 * (p0 + p1). This can then be used to calculate the axis-aligned slant angle of the circle segment and determine a rotation axis rotAxis perpendicular to the circle segment's plane. Then math:

circleSegmentDist = pCenter.dot(rotAxis)
circleSegmentRadius = sqrt(1.0 - circleSegmentDist * circleSegmentDist) # equal to sin(acos(abs(circleSegmentDist)))
arcAngle = 2 * w.angle(p0 - (pCenter - ringSegmentRadius * w.normalized()))

The rest is a loop which finds the vertices by rotating p0 around rotAxis using angles between 0.0 and arcAngle.

This gives us this result (which matches your samples quite well):

quad sphere with equal edge lengths within edge loops

However, by rotating a copy of the sphere around its center by 90°, we can show that there still is some error, revealing the math turns out slightly differently depending on whether we rotate vertices in x- or in y-direction within a "side":

enter image description here

I am not sure right now where the problem comes from. I suspect the assumption about the circle segment vertices lying within a plane might be wrong. I believe the error is too large to be caused by floating point arithmetic.

Either way, you can get it on Github: https://github.com/Zyl9393/even_quad_sphere

$\endgroup$
3
  • 1
    $\begingroup$ The notion that what I proposed is "mathematically impossible" is simply not true. It's true that you get something that isn't a sphere if you just use the "space" function in Blender, but you have to combine that with Alt+Shift+S to turn your shape back into a sphere. A perfectly spaced quadsphere is possible. I have made many of them, here they are: blend-exchange.com/b/NneqxyAv These all meet the following two conditions: 1) each vertex is the same distance away from the center of the object, and 2) each edge loop is comprised of equal length edges. $\endgroup$
    – Rekov
    Commented May 30 at 19:15
  • $\begingroup$ @Rekov I'm not saying it's mathematically impossible, but within just seconds I found some discrepancy in the file: quadsphere_3_3_4: i.imgur.com/lz20uXn.png BTW you never answered my question in the comment to the question. $\endgroup$ Commented Jun 5 at 22:02
  • $\begingroup$ I gave it another shot and edited my answer, with limited success. I am still not 100% convinced it is possible; there are subtle inaccuracies in the samples, as @MarkusvonBroady has pointed out. I tried posting the question on the math stackexchange, because I find it quite interesting: math.stackexchange.com/questions/4928189/… $\endgroup$
    – Zyl
    Commented Jun 5 at 22:16

You must log in to answer this question.

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