geeks have feelings

Better-er Spheres, Fewer-er Triangles

Series index: Part I (this post), Part II, Part III

Back in 2009 I wrote a post about icospheres. It ended, “To be completed….” Completing it now.

The case for icospheres §

It might be easier for us thinkmeats to imagine UV spheres: globes with latitudes and longitudes.

But for silicon, or at least rasterizing* GPUs, an icosahedron better approximates a sphere with fewer triangles (20 to be exact), and they’re already all equilateral and each equal size to the others. Moreover, if more detail or a smoother surface is needed, we can subdivide the faces into smaller triangles.

Recursive midpoint subdivision §

The best known method is simple and elegant. Because the icosahedron has congruent (equal-sized) equilateral (each side and corner equal) triangular faces, we can picture a single “root” face being subdivided into an “icosa-wedge” to understand how the entire icosphere is constructed. See animated figure above.

  1. Start with a regular icosahedron, inscribed in a unit sphere.
  2. Split each triangle into four by midpointing its edges then connecting the midpoints.
  3. Project all the new vertices back to unit length.
  4. Repeat until your GPU lawyers up against your abuse.

This is a modified case of Loop subdivision§ whose typical behavior after quartering faces is a “weighted average of neighbors” that yields a mostly- limit surface. Because the desired mesh at the limit is a unit sphere, we don’t need the special Loop weights. It’s faster and more exact to constrain vertices to distance 1 from the origin, projecting them onto the sphere’s surface by its definition.

If, and take this if as a hefty Oedipus Rex-sized umbra of foreshadowing, we can split each face of the icosahedron into four congruent equilateral triangles, then the resulting icosphere, regardless of subdivision depth, must consist of only congruent equilateral triangles. How convenient, right?

The exponential growth is annoying §

Besides the (maybe implied) properties of its results, there’s also an annoying wrinkle to the algorithm: each round of subdivision quadruples the triangle count, yielding 20×4d triangles after d rounds.

Subdivision depth dTriangle count
020
180
2320
31280
45120
520480

This works great because you can generate lots of mesh density with few rounds, but exponential growth is… exponential. It’s actually somewhat unwieldy for 3D.

It sounds nice to grow detail fast, but in practice, it’s a lousy knob for budgeting mesh density.

As a reminder, a sphere’s surface area is 4πr2 . In general, surface area of anything grows with the square of linear dimension growth, so you’d want triangle count to grow at the same quadratic rate to fill the surface. A knob that controls the square of triangle count would—when turned—linearly control triangle density, making it a much more intuitive “visual detail” control than an exponential curve.

Triangle growth comparisonA chart comparing midpoint subdivision growth with one-pass one-over-n subdivision growth.0123midpoint subdivisionone-pass 1/n subdivision
Triangle growth curves for recursive midpoint and one-pass subdivision: same starting point, very different escalation.

One-pass 1/n subdivision §

The method I’ve seen and always thought was superior is one-pass subdivision: divide each edge into n equal segments (by adding n1 new vertices), generate the face’s interior once, then project everything to the sphere.

One-pass 1/n subdivision: build the full face grid once, then project to the sphere.

In fact, this is what we see on Wikipedia for geodesic polyhedra.

Three solids: an icosahedron, an icosahedron with faces subdivided along edges split evenly into sixths, then an icosphere from the projected icosahedron.
Geodesic icosahedral polyhedron example
Wikimedia Commons, User: Tomruen, CC BY-SA 4.0

Now we get 20×n2 triangles, which is much easier to budget around, while still being able to generate any of the triangle counts that midpoint subdivision can generate. It’s a win with nothing traded away, right?

Subdivision depth dSubdivision segments nTriangle count
0120
1280
3180
24320
5500
6720
7980
381280
9 … 151620 … 4500
4165120
17 … 315440 … 19800
53220480

1/n subdivision provides so much more granularity than recursive midpoint that this table is shown collapsed; else, it would’ve spanned 33 rows to depict five rounds of recursion.

“Dope,” I thought, “same 320 tris, same icosphere, done.” Time to take a side quest.

Urgent tangent: “geodesic” domes §

Quick aside: where does the geodesic part of geodesic dome come from? Peep the Greek roots of the word: geo- means “earth” (think Gaia) and -desic comes from daiein, meaning “to divide.” Fair enough!

However, be careful with etymology. Geodesy, which obviously shares the same roots, refers to the art of earth measurement. It significantly predates geodesic domes, both the structures and the term as used by John G. DomeBuckminster Fuller, probably the figure most closely associated with them. Meaning, geodesic stayed truer to its roots than geodesy did, and even more so than geometry. To make things even clearer (/s): in geodesy and geometry, a geodesic—as a noun—is the shortest path between two points. Sound good?

So what’s the etymology of geometry? Why, “earth measurement,” of course.

Anyways, back to the mesh: if one-pass and midpoint reach the same triangle counts, they should produce the same geometry.

The proof of the polygons is in the rendering §

So, take the 16-triangle wedge produced by the 1/n subdivision ( n=4 ) and overlay it on the 16-triangle wedge produced by the recursive midpoint subdivision. We should see the meshes line up, right? They should be so similar that we get some Z-fighting.

Overlay at equal triangle count: midpoint in orange, one-pass in blue.

Nope, can’t triforce.

They don’t just “floating point epsilon stability” “not line up.” They aren’t just “slightly offset due to accumulated error.” They’re actually visibly different with a distinct dihedral-symmetric pattern in which triangles sit proud of their counterparts, suggesting that the algorithms construct different meshes, not the same mesh with different noise.

If the mismatch pattern is too structured to be numerical noise, then something else is up: they don’t interpolate along the same path(s). Midpoint recursion keeps reprojecting local midpoints onto the sphere. One-pass 1/n first spaces points linearly along a chord, then projects. Those are different geometric operations, and the difference should have a predictable angular error profile over the edge parameter t .

Maybe the distortion and its cause are obvious without the visual aid. But don’t worry; there’s a lot of analysis left and we’ve still yet to call back to the foreshadowing about the midpoint method’s if yet. That is, except for the previous sentence. That’s definitely a callback.

To be completed… but actually.

Every Post by Year

  1. 2026
    1. Geodesic Geometrics
    2. Interpolation Tribunal
    3. Better-er Spheres, Fewer-er Triangles
  2. 2025
    1. SSH into Windows 11 WSL2 with Agent Forwarding
  3. 2023
    1. Ducati Timing Belt Replacement
    2. C++ Corrections
  4. 2016
    1. Liftlord
    2. Sensorless Brushless Can’t Even
  5. 2015
    1. Big Data: Test & Refresh
  6. 2014
    1. The Orange Involute
    2. Big Data EVT
  7. 2013
    1. Integer Arithmetic Continued
    2. Real Talk: Integer Arithmetic
    3. Why Microsoft’s 3D Printing Rocks
    4. Flapjack Stator Thoughts
    5. Delicious Axial Flux Flapjack
  8. 2012
    1. How to teach how to PCB?
    2. Fixed-point atan2
    3. It Was Never About the Mileage
    4. Trayrace
    5. BabyCorntrolling
    6. Conkers
    7. BabyCorntroller
    8. Templated numerical integrators in C++
  9. 2011
    1. Bringing up Corntroller
    2. Assembly-izing Tassel
    3. Corn-Troller: Tassel
    4. 5 V to 3.3 V with Preferred Resistors
  10. 2010
    1. HÄRDBÖRD: Interesting Bits
    2. HÄRDBÖRD: Hardcore Electric Longboard
    3. Mistakes to Make on a Raytracer
    4. US International Dvorak
  11. 2009
    1. Raxo
    2. Better Spheres, Fewer Triangles
    3. Donald Knuth Finally Sells Out
    4. Harpy – Sumo Bots 2009