Hi,
Does anyone have experience with creating points on sphere with Fibonacci order in Grashopper, similar to the attached image?
I would appreciate any help
Hi,
Does anyone have experience with creating points on sphere with Fibonacci order in Grashopper, similar to the attached image?
I would appreciate any help
I’m a bit late to this party, but came across this post a few days ago:
http://extremelearning.com.au/how-to-evenly-distribute-points-on-a-sphere-more-effectively-than-the-canonical-fibonacci-lattice/
I’ve re-written it as a C# component, which outputs the Fibonacci lattice, spiral and sphere (shown below)
200724 Fibonacci Sphere.gh (6.2 KB)
The post above talks about some minor optimisations to improve the spacing, which I didn’t bother implementing.
The next challenge is how to mesh these points. I’ve tried delaunay on the spiral result and then remap the mesh to the sphere points but this leaves a hole in the bottom. I guess we need convex hull, so should probably try weaverbird or something…
Cheers,
Steven
Here’s the ‘Quick Hull’ from the Polyhedra plugin:
And here’s what happens when you delaunay the original fibonacci lattice and then remap the mesh back on to the sphere:
File attached in case anyone wants to play further!
200727 Fibonacci Sphere (mesh wrap 2).gh (25.3 KB)
Steven
Nice explorations.
If you use a stereographic projection, you can do the triangulation in the plane without that seam, and get the same result as from the convex hull
That’s brilliant, thanks! I’d not seen that type of projection before. Is it commonly used?
Also, a good trick to plug the normal into the color input for the mesh to get a quick result.
It gives some pretty awesome results when the angle is set to other values:
At T = 1.05pi:
Stereographic projection crops up in geometry quite often because it is conformal (angles stay the same and circles stay circular).
It isn’t used much for typical map making of earth because it massively distorts areas far from the origin. Apparently it is sometimes used for mapping other planets though, as it is the only mapping where all circular craters map to circles in the plane.
I find it a fun topic with links to lots of interesting mathematics-
This film explores the connections between stereographic projection and Möbius Transformations:
http://www-users.math.umn.edu/~arnold//moebius/
Henry Segerman’s book Visualizing Mathematics with 3D Printing has a bit about stereographic projection (and its all done with Rhino).
http://www.3dprintmath.com/
There’s a also an old video series called Dimensions that has some nice visualizations (and the later episodes go on to cover the Hopf fibration):
I had done some experimentation with this idea. Never took it very far, but maybe this will help?
This image contains 2 components.
1 - A python component that makes a reasonable approximation of an “even distribution” of points on a sphere. (never really refined the code, was just a test).
Code:
# reference: https://stackoverflow.com/questions/9600801/evenly-distributing-n-points-on-a-sphere/26127012#26127012
"""Phyllotaxis 3D: Sphere. This method is a reasonable approximation for evenly distributing
points in a spherical fasion, resembling phyllotaxis. I honestly don't know what you would use this for....
Inputs:
num_pts: number of points to generate
cap: experimental...
Output:
a: points arranged in a mathematically approximate even distribution on a sphere
output can be used with 3D Convex Hull and WB Mesh Dual for strip creation
lines: collection of lines that can be used to generate Meshes using WB mesh from lines"""
__author__ = "chanley"
__version__ = "2018.03.29"
ghenv.Component.Name = "OTools_PyhlloSphere3D_Even"
ghenv.Component.NickName = 'O_PSphere3D_Even'
ghenv.Component.Category = "OTools"
ghenv.Component.SubCategory = "7 | Phyllotaxish"
try: ghenv.Component.AdditionalHelpFromDocStrings = "1"
except: pass
import math
import Rhino
import rhinoscriptsyntax as rs
a = []
lines = []
# evenly distribute points on a sphere, analogous to phyllotaxis
try:
for i in range(0, num_pts):
phi = math.acos(1 - 2*i/num_pts)
theta = math.pi * (1 + 5**0.5) * i
a.append(Rhino.Geometry.Point3d(math.cos(theta) * math.sin(phi), math.sin(theta) * math.sin(phi), math.cos(phi)))
except:
pass
# use lines to connect points to create cells
try:
for i in range(1, len(a)-8):
lines.append(rs.coercegeometry(rs.AddLine(a[i], a[i+5])))
lines.append(rs.coercegeometry(rs.AddLine(a[i], a[i+8])))
except:
pass
# due to the nature of spherical coordinates and the meshing algorithm being used, the meshing gets a litte
# dicey at the polar caps....this might be an approach to manually creating the cells at the polar caps.
try:
if len(a) > 5 and cap == True:
print "cap face order is not quite right yet, not sure if this even is possible....."
# cap top...not sure of order
lines.append(rs.AddLine(a[1], a[3]))
lines.append(rs.AddLine(a[1], a[4]))
lines.append(rs.AddLine(a[2], a[3]))
lines.append(rs.AddLine(a[2], a[4]))
lines.append(rs.AddLine(a[2], a[5]))
lines.append(rs.AddLine(a[3], a[5]))
except:
pass
try:
#cap bottom...not sure of order
if len(a) > 8:
print (len(a)-5)
lines.append(rs.AddLine(a[len(a)-1], a[len(a)-2]))
lines.append(rs.AddLine(a[len(a)-1], a[len(a)-3]))
lines.append(rs.AddLine(a[len(a)-1], a[len(a)-4]))
lines.append(rs.AddLine(a[len(a)-1], a[len(a)-6]))
lines.append(rs.AddLine(a[len(a)-2], a[len(a)-4]))
lines.append(rs.AddLine(a[len(a)-2], a[len(a)-5]))
lines.append(rs.AddLine(a[len(a)-2], a[len(a)-7]))
lines.append(rs.AddLine(a[len(a)-3], a[len(a)-5]))
lines.append(rs.AddLine(a[len(a)-3], a[len(a)-8]))
except:
pass
2 - A Cluster of native GH components that results in a distribution with tighter spacing at the poles.
NOTE: the image above uses MeshEdit2 plugin: 3D ConvexHull and WeaverBird: Dual graph.
I’ll upload the file, but I don’t think my components will come through as I have them saved as user objects. You should be able to recreate from info above.
phyllotaxish.gh (27.4 KB)
Hi,
I have an extended question to the Fibonacci lattice. Does anyone know how to create the lattice on a 4D sphere? I need to get a list of 4D points for further quaternion calculations. Any suggestions @Steven, @DanielPiker, @René_Corella? Thank you.