i am looking for an algorithm ( in pseudo code) that generates the 3d coordinates of a sphere mesh like this:
FWIW, you can use meshzoo (a project of mine) to generate meshes on spheres very easily.
You can optionally use optimesh (another one out of my stash) to optimize even further.
import meshzoo
import optimesh
points, cells = meshzoo.icosa_sphere(10)
class Sphere:
def f(self, x):
return (x[0] ** 2 + x[1] ** 2 + x[2] ** 2) - 1.0
def grad(self, x):
return 2 * x
points, cells = optimesh.cvt.quasi_newton_uniform_full(
points, cells, 1.0e-2, 100, verbose=False,
implicit_surface=Sphere(),
# step_filename_format="out{:03d}.vtk"
)