Kami – Recursion practice – ring of spheres

03 ring of spheres

 

import math
import rhinoscriptsyntax as rs

def ringofSpheres():
pi = math.pi
dblTwistAngle = 0.0
for a in rs.frange(0.0, 2*pi, (pi/15)):
z = .5
x = 5 * math.sin(a + dblTwistAngle)
y = 5 * math.cos(a + dblTwistAngle)
rs.AddSphere([x,y,z], 0.5) #the center and radius
#this is for the first ring of spheres

def stacktheRings():
pass

def generateTubeofStackedSpheres():
ringofSpheres()
stacktheRings()

generateTubeofStackedSpheres()

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s