Sunday, June 7, 2009

02B - Masha - Loft












import maya.cmds as cmds
from random import *
from math import *

#numPoints = 60
numCurves = 40.0
radius = 10

def Curve(numPoints):

#create an empty list to store the point
points = []
#loop and gather point information
for i in range (1, numPoints, 1):
amplitude = 1
#function for the spiral curve
x = sin(i)*amplitude
y = 0
z = i
myPoint = (x,y,z)
#store the point in the list
points.append(myPoint)

#create the curve
myCurve = cmds.curve (d = 3, p=points) #degree 3
return myCurve

def Curve2(numPoints):

#create an empty list to store the point
points = []
#loop and gather point information
for i in range (1, numPoints, 1):
amplitude = 1
#function for the spiral curve
x = (cos(i)*amplitude)
y = 0
z = i
myPoint = (x,y,z)
#store the point in the list
points.append(myPoint)

#create the curve
myCurve = cmds.curve (d = 3, p=points) #degree 3
return myCurve

myCrv = []
y1 = 0
angle = 360/numCurves
x1 = radius
z1 = 10
for i in range (0, numCurves+1, 1):
if i%2 == 0:
curve1 = Curve(50)
else:
curve1 = Curve2(50)
#cmds.move (0,0,10, curve1)
#cmds.rotate( 0, 0, 90, curve1, pivot=(0,0,0))
cmds.rotate( 0, 0, angle*i,curve1, pivot=(x1,y1,z1))

#cmds.move (j,j,0, curve1)
myCrv.append (curve1)
print myCrv

cmds.loft(myCrv)

No comments:

Post a Comment