Function sphereTriangulation discretize a sphere parametrized with:
- radius R and,
- number of division.
Triangles are formed by spiting unit octahedron triangles, so nice mesh is retrieved. My usage was for FEM analysis - results are stored so that they could be used for saving in STL and further meshing.
Code is short and commented, if You have any question You can post.