Sphere mesh from Fibonacci lattice

Metadata
aliases: []
shorthands: {}
created: 2022-02-27 23:14:39
modified: 2022-03-18 16:05:29

We can generate a set of points along the surface of a sphere in a highly uniform distribution by placing the points according to a Fibonacci lattice^[González, Á. (2010). Measurement of areas on a sphere using Fibonacci and latitude–longitude lattices. Mathematical Geosciences, 42(1), 49–64. Link
]. In this method, we generate the points, then create the mesh using Delanuay triangulation.

The result of the method is shown by the following figure with vertices. The color of the triangles shows the area of a given triangle.

The ratio of areas between the largest and smallest triangle on the mesh:

This is a very good value.

Algorithm

This function is written in Python and uses the separate arrays convention for storing triangle meshes. There are two different functions, one just returns a single point, the other puts the points into the arrays and determines the indices using Delanuay triangulation. The triangulation methodis imported from scipy.

import numpy as np
from scipy.spatial import Delaunay

def generate_sphere_fibonacci(r=1, N=100):
    x = []
    y = []
    z = []
    N = N // 2
    # Generate the vertices
    for k in range(-N, N + 1):
        x_new, y_new, z_new = get_point_fibo(k, N)
        x.append(x_new)
        y.append(y_new)
        z.append(z_new)

        # Run the Delanuay triangulation
    points = np.array([x, y, z]).T
    tri = Delaunay(points, furthest_site=True)
    # Retrieve the indices
    i = tri.convex_hull[:, 0]
    j = tri.convex_hull[:, 1]
    k = tri.convex_hull[:, 2]

    return x, y, z, i, j, k

# Returns a single point
def get_point_fibo(i, N):
    gratio = 1.6180339887498948482045
    latitude = np.arcsin((2.0 * i) / (2.0 * N + 1.0))
    longitude = 2 * np.pi * i / gratio

    x = np.cos(longitude) * np.cos(latitude)
    y = np.sin(longitude) * np.cos(latitude)
    z = np.sin(latitude)

    return x, y, z