Thursday, July 23, 2009

02-A Zhulei







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

#from curves to surfaces
#step 1, create a curve
def curves (amplitude):
#def initial variables
numPoints=80
#create an empty list to store the points
points=[]
#loop and gather information
for i in range (1,numPoints,1):
#function of the spiral curve:
x=sin(i*3)
y=cos(cos(i)*2+1)
z=i
myPoint=(x,y,z)
#store the points in the list
points.append(myPoint)
myCurve=cmds.curve(d=60, p=points)

#create an empty list to store the curves
myCurve=[]
#define the number of curves
numCurves=10
#function to call the curves in a loop
for i in range(0,numCurves,2):
crv=curves(i)
#store the curve in the list
myCurve.append (crv)
print crv
#move the curves
cmds.move(2,11,4, crv)
#loft the curves
cmds.loft(myCurve)

No comments:

Post a Comment