Monday, June 8, 2009

Lofting curves - Deborah Kaiser



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

# Surfaces from curves
#Curves
def curves (amplitude):
numPoints= 50
#list to store the points
points=[]
#loop
for i in range (1,numPoints,1):
#function of the spiral curve:
x=sin(i)*100
y=cos(i)*amplitude*i/10*tan(i)
z= i*2*sin(i)
myPoint= (x,y,z)
#store the points in the list
points.append(myPoint)
myCurve=cmds.curve(d=3, p=points)
return myCurve
#List to store the curves
myCurve=[]
#Number of curves
numCurves=20
#Call the curve 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 (10,50,1, crv)
#Lofting the curves
cmds.loft(myCurve)

No comments:

Post a Comment