import maya.cmds as cmds
from math import *
from random import *
radius = 50
numCirc = 10
amplitude = 2
def curves(amplitude):
numPoints = 10
points = []
#loop and gather point information
for i in range (1, numPoints, 1):
#function for the spiral curve
x = sin(i)*amplitude
y = cos(i)*amplitude
z = i*(i+1)
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
numCol = 10
numRows = 10
def array(numCol):
#create empty list of curvs
numCurvs = []
for j in range (0, 360/numCirc, 1):
#create curve and then rotate
crv = curves (j)
cmds.rotate( 0, 10*j, 0, crv )
#store the point in the list
numCurvs.append (crv)
cmds.select (numCurvs)# select the number of created curvs
cmds.group (numCurvs, r=True)
#loop which made copies of created curvs in 2 directions
for m in range (0, numRows, 1):
for n in range (0, numCol, 1):
ar = array (1)
s = randint(0,3)
cmds.move (n*200, 0, m*200)
#change the size of group of curvs
cmds.scale (s,s,s)
squareINsquare (3)
Sunday, May 24, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment