# Cone with phyllotaxis Structure

I want to make a pine cone with its natural form using python scripting. Anybody working on the same problem?

you might want to read through The Algorithmic Beauty of Plants, it covers cones in chapter 4 together with a good tutorial video from which you might get this as a starting point:

``````import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
import math

def Phyllotaxis():
c = 4
pts = []
for n in xrange(1,1000):
r = c * math.sqrt(n)
x = r * math.cos(a)
y = r * math.sin(a)
pt = Rhino.Geometry.Point3d(x,y,0)
pts.append(pt)

Phyllotaxis()
``````

_
c.

1 Like

@clement Thank you for your reply. I already got inspiration from Daniel’s video on YouTube. But now I want to create Pine structure and nor able to write the script.

It would be helpful for me if you could explain a = n * math.radians(137.5) code of line. I am not getting how are you multiplying angel with for loop iteration.

Regards
Kuldeep

Hi @kggadhavi, this line just multiplies the step angle for each loop. Since the formula works using a circular measure in radians, the angle is converted from degree to radians. I guess that the conversion can also happen outside of the loop, but the multiplication with n (the loop counter) must remain in the loop.

btw. changing the angle has significant impact on the result. You probably found that already, here is a video what changes if the angle is modified during the loop…

_
c.

1 Like