'How to generate a subdivided icosahedron?

I've asked some questions here and seen this geometric shape mentioned a few times among other geodesic shapes, but I'm curious how exactly would I generate one about a point xyz?



Solution 1:[1]

There's a tutorial here.

The essential idea is to start with an icosahedron (which has 20 triangular faces) and to repeatedly subdivide each triangular face into smaller triangles. At each stage, each new point is shifted radially so it is the correct distance from the centre.

The number of stages will determine how many triangles are generated and hence how close the resulting mesh will be to a sphere.

Solution 2:[2]

To tesselate a sphere, most people sub-divide the points linearly, but that does not produce a rounded shape.

For a rounded tesselation, rotate the two points through a series of rotations.

  1. Rotate the second point around z (by the z angle of point 1) to 0
  2. Rotate the second point around y (by the y angle of point 1) to 0 (this logically puts point 1 at the north pole).
  3. Rotate the second point around z to 0 (this logically puts point 1 on the x/y plane, which now becomes a unit circle).
  4. Find the half-angle, compute x and y for the new 3rd point, point 3.
  5. Perform the counter-rotations in the reverse order for steps 3), 2) and 1) to position the 3rd point to its destination.

There are also some mathematical considerations for values near each of the near-0 locations, such as the north and south pole, and the right-most and left-most, and fore-most and aft-most positions, so check those first and perform an additional rotation by pi/4 (45 degrees) if they're at those locations. This prevents floating point math libraries from freaking out and producing wildly out-of-character values for atan2() and other trig functions.

Hope this helps! :-)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jespertheend
Solution 2 Tim Cooper