I want to make a pine cone with its natural form using python scripting. Anybody working on the same problem?
import Rhino import scriptcontext import rhinoscriptsyntax as rs import math def Phyllotaxis(): c = 4 pts =  for n in xrange(1,1000): a = n * math.radians(137.5) 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) rs.AddPointCloud(pts) Phyllotaxis()
@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.
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…