# Generate Geodesic Sphere from Hex and Pentagons

I have two polygonal meshes, a hexagon and a pentagon (They are tiles in a strategy game). I want to use them to construct a geodesic sphere (https://upload.wikimedia.org/wikipedia/commons/e/e7/G%C3%A9ode_V_3_1_duale.gif).

I can modify the sizes of each mesh to fit what I need, but I can't figure out how to get the radial coordinates of each face in the geodesic sphere. Is there a way to do this?

I'd like to only need two meshes for the tiles, but I can make different versions if absolutely necessary.

• The hexagons will all be slightly different, and not just by size. If they were all the same you'd just end up with a flat plane. – MooseBoys Dec 9 '15 at 7:27
• That's what the pentagons are for, @MooseBoys – Draco18s no longer trusts SE Dec 9 '15 at 15:28
• @Draco18s Those only get you the vertices of the base icosahedron. If you want curvature across the surface, you need to warp the hexagons. – MooseBoys Dec 9 '15 at 15:42
• MooseBoys is right, in general the hexagons will be slightly irregular in shape, not just different sizes. I'll elaborate in an answer this evening if nobody else beats me to it. ;) – DMGregory Dec 9 '15 at 19:11

## 2 Answers

The typical way is to map a triangular grid of the desired density over the faces of a Platonic solid (specifically an icosahedron if you want to use hexagons and pentagons). I describe mapping triangular grids onto icosahedra in this answer, and you can find more details here. This method lets you change the number and arrangement of tiles very flexibly, so you can make any of the three classes of geodesic: Next, you project each vertex of the mapped grid onto an enclosing sphere. There are many ways to do this...

• Gnomonic Projection is the easiest - just normalize the vector to get its projection onto the unit sphere. This leads to significant distortion however - hexagon tiles near the middle of each icosahedral face will be much larger than those near the pentagons at the corners.

• Recursive subdivision is probably the most popular. Starting with one triangular face of the icosahedron, find the midpoint of each edge and project it gnomonically onto the sphere. Join these new points to split the original triangle into four smaller triangles. Now you can repeat the process on each of those four until you reach your desired density. This does a better job of spreading out the distortion than pure gnomonic, but there are only certain geodesic breakdowns it can achieve (most easily: Class-I with frequencies that are a power of two)

• Snyder's equal-area projection, or similar projections, are common in geographic information systems. They reduce the distortion while still giving you flexibility to use any class of geodesic, but they tend to be complex to implement or, as in the link above, described in academic papers locked behind a paywall.

• Buckminster Fuller developed a projection for his Dymaxion Map that also reduces distortion, but while it's easy to find a description of the method, equations to execute it also tend to sit behind a paywall.

Once you have your points projected onto the sphere, each one becomes the center and normal for a face (this is performing the dual operation to get a Goldberg polyhedron). You can get the vertices of these faces by taking the three faces that surround each vertex and intersecting the planes defined by their positions/normals.

The way I would do that is to create an icosahedron and then divide the edges in steps until you have a geodesic:

1. Create an icosahedron with a 1 unit radius (we can scale the whole thing later). You'll have one vertex at the zenith of your sphere and one at the nadir. Then 5 vertices evenly spaced at 30°N latitude and again at 30°S latitude, so basically every 72° of longitude. The ones at 30°N will be halfway between the ones at 30°S latitude. That gives you your 12 vertices of an icosahedron.

2. Divide the edges into thirds. For every pair of vertices that share an edge, create two new vertices that break the edge into thirds. What will happen when you do that is that you will now have four vertices per edge, but they will all lie in a straight line. Its not really a geodesic at this point so you need to adjust those vertices so that they lie on the surface of that sphere, so assume each vertex is a vector and divide that vector by it's own length. That essentially normalizes it and places it at one unit from the center again.

3. You now have enough vertices to make a geodesic out of triangles. But it looks like you want smaller triangles. So divide all those edges again the same way. Don't forget to divide the new edges as well. It's easiest if you divide the edges into halves this time so that you can systematically create triangles. repeat as necessary until you have as many divisions as you like. Again, you'll need to normalize all those new vertices so they fit onto the outside of a sphere again at one unit distance from its centroid.

4. Once you are done dividing to the size you like you can use the triangles in sets of six to make hexagons and in exactly twelve spots (your vertices from step 1) there will only be five adjacent triangles from which you make your pentagons. You'll have to distort your hexagons slightly to fit them into these non-equilateral hexagons. Your pentagons will be fine.