designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Fermat’s Spiral with Rhino Python

July 30, 2017 | Algorithms
#fermat #fibonacci #phyllotaxis #rhino-python #spiral

As studied earlier in Grasshopper here, the sunflower spiral, or Phyllotaxis, or Fermat‘s spiral, could be drawn as an exercise in looping in Rhino Python.

Fermat’s Spiral with Rhino Python fermat, phyllotaxis
import rhinoscriptsyntax as rs
import math
s = 137.508
for n in range(0,500):
    t = math.sqrt(n)
    g = n * s
    z = rs.Polar([0,0,0],g,t)
    rs.AddCircle(z,0.3)

Phyllotaxis is the arrangement or patterning of leaves, flowers, or other plant parts around a stem or axis. Thus, it refers to the specific geometric arrangement of these structures in plants. The term “phyllotaxis” comes from the Greek words “phyllon” (meaning “leaf”) and “taxis” (meaning “arrangement” or “order”).

Phyllotaxis can vary widely among plant species and often follows specific mathematical patterns. One of the most well-known patterns is the Fibonacci sequence, in which each number is the sum of the two preceding ones (e.g., 0, 1, 1, 2, 3, 5, 8, 13, …). In some plants, the number of spirals or whorls of leaves or other plant parts follows the Fibonacci sequence. This results in a visually appealing arrangement.

If you are new to Rhino Python, you may wonder how you are going to write this code. Just type EditPythonScript in the Rhino command bar and open the Python editor. Then write the code shown above and press F5 to run it. Alternatively, I prepared a Grasshopper definition including the same Python code as a component. Here it is:

Fermat’s Spiral with Rhino Python Grasshopper definition
Grasshopper definition (GH)Download

Cite this post

Yazar, T. (2017, July 30). Fermat’s Spiral with Rhino Python. designcoding. Retrieved October 24, 2026, from https://www.designcoding.net/fermats-spiral-with-rhino-python/

Related Posts

Sunflower Spiral

December 22, 2011

Sunflower Spiral (or Phyllotaxis) can be constructed in Grasshopper according to Vogel’s model of parametric relationships. This model uses polar coordinates. The Grasshopper file is still working after more than 11 years -15.12.2022. This is such a powerful quality of Grasshopper, I think. It’s a good example of utilizing polar coordinates. It’s also fun to play with the parameters and constraints of the Sunflower Spiral. Also, there are very interesting results if you also connect the polar angle value to…

Fermat’s Nightmare

October 14, 2026

Revisiting a specific mathematical phenomenon that I previously explored twice, here (in 2017) and here (in 2011), from a different angle in 2026 now. This was the final video (from 2023) that I found in my junk folder during the blog’s resurrection. Today, designers mostly know Fermat through the famous 137.5-degree angle of rotation, which is the mathematical formula used to describe the arrangement of sunflower seeds. However, today I will speculate on a nightmare of Fermat’s. Because Fermat, in…

Fibonacci Portraits

December 27, 2023

“In the heart of a sunflower’s embrace, its seeds weave a poetic tale—a dance of two spirals, parastichies they’re called. One unfurls gracefully from the center in the hush of clockwise whispers, while its counterpart whispers secrets in the tender breaths of counterclockwise motion. A subtle ballet unfolds, where the number of these spirals gracefully mirrors the whispers of adjacent Fibonacci numbers, composing a delicate symphony in the sun-kissed fields.” says ChatGPT if I force it to be a little…

Fibonacci Dome

March 1, 2024

This is the continuation of my previous study on the Fibonacci lattice on a spherical surface, creating a Fibonacci Dome structure. The panelization of curved forms with flat surfaces has been a favorite topic in architectural geometry. The trigonometric layout of the Fibonacci sequence generates a spherical formation, while the Faceted Dome component handles planarity. Here, I further enhanced the previous code into a pavilion design. The essential part of the code is about the placement of points on the half…

Fibonacci Sphere

April 12, 2023

This website explains the problem and several solutions. I managed to implement the formulas to convert a 2D square grid into spherical coordinates. The Fibonacci Sphere is one of the solutions to the equal distribution of points on a sphere. It is not the best solution to this problem. But it is regarded as a quick and efficient one. Suitable for me. I developed this Grasshopper code by studying the above website and some other sources. The code starts with…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • Table of Contents
    • Monthly Archive

    • All Keywords
    • #grasshopper
    • #tutorial
    • #polyhedra
    • #pattern
    • #sphere
    • #fourier
    • #simulation
    • #design-object
    • #parametric-curve
    • #bezier-curve
    • #design-education
    • #terrain
    • #vector-field
    • #visualization
    • #linear-algebra
    • #image-sampler
    • #rhinoceros
    • #dome
    • #voronoi
    • #harmonic
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement