Showing posts with label 02B. Show all posts
Showing posts with label 02B. Show all posts

Sunday, July 12, 2009

02B - Anthony Adelmann


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= 70
#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)*amplitude
y=cos(i)*amplitude
z=i
myPoint=(x,y,z)
#store the points in the list
points.append(myPoint)
myCurve=cmds.curve(d=3, p=points)
return myCurve
#create an empty list to store the curves
myCurve=[]
#define the number of curves
numCurves=19
#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(3,11,4, crv)
#loft the curves
cmds.loft(myCurve)

Tuesday, June 16, 2009

Assiment_02B




02B_COSMOS BEDZRA_SURFACE





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


#REVOLVING A CURVE TO FORM A SURFACE
def revolve(numPoints,myAxis,myEndSweep):
"revolve a curve"
myPoints=[]
for i in range(numPoints):
x=uniform(0,20)
y=10
z=i*5
myPoints.append([x,y,z])
crv=cmds.curve(ep=myPoints,d=3)
cmds.revolve(crv,axis=myAxis,endSweep=myEndSweep)
revolve(10,[1,0,1],90)

Monday, June 15, 2009

week05_assignment_Masha















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


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 = randint(0,3)
amp = randint(0,3)
#function for the spiral curve
a=i*0.3
x = cos(a)*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 = randint(0,3)
amp = randint(0,3)
#function for the spiral curve
a = i*0.3
x = sin(a)*amplitude
y = i
z = amp*4
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 tubulize (path, radius, tubeSections = 8):
"Function to create tubes out of curve"
#position on end of curve where i will put the circle profile
pos = cmds.pointOnCurve (path, position = 1, pr = 0.001, top = 1)
#get tangent of this point
tan = cmds.pointOnCurve (path, tangent = 1, pr = 0.001, top = 1)

#create the profile circle
profile = cmds.circle (c=pos, r = radius, normal = tan, s= tubeSections, ch = 1)
#center of circle pivot
cmds.xform (cp = 1)
#extrude the circle along path
tube =cmds.extrude (profile [0], path, ucp =1, upn=1,et=1,rb=1,dl=3,ch=1, n ="spiralTube" )
#returne values
return [tube[0],radius,profile]

radius = 6
numCurves = 200
myCrv = []
y1 = 0
angle = 360/numCurves
x1 = radius
z1 = 10

for i in range (0, numCurves+1, 1):
rad = randint(3,8)
r = rad/10.0

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))
#curve1= Curve(30)
cmds.rotate( 0, 0, angle*i+i,curve1, pivot=(x1,y1,z1))
crv1 = tubulize (curve1, r, tubeSections = 8)
#cmds.move (j,j,0, curve1)
myCrv.append (curve1)

Wednesday, June 10, 2009

02 B - Valentina De León



import maya.cmds as cmds
from math import*
from random import*
#creating the curve
def curves (amplitude):
numPoints= 40
points=[]
#loop
for i in range (1,numPoints,1):
#function of the spiral curve:
x=sin(i)*amplitude
y=cos(i)*amplitude/30
z= i
myPoint= (x,y,z)
#points in the list
points.append(myPoint)
myCurve=cmds.curve(d=30, p=points)
return myCurve
#list to store the curves
myCurve=[]
numCurves=70
#function
for i in range(0,numCurves,5):
crv= curves (i)
myCurve.append (crv)
print crv
#moving the curves
cmds.move (45,70,35, crv)
cmds.loft(myCurve)

Tuesday, June 9, 2009

02B - Deborah Kaiser - Lofting curves (exploring the results with different functions)



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=i*i/10
y=x*x*.5
z=y*x*sin(i)*.03
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 (15,10,30, crv)
#Lofting the curves
cmds.loft(myCurve)

Monday, June 8, 2009

02B - Deborah Kaiser - Lofting curves (exploring the results with different functions)



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=tan(i)*amplitude
y=sin(i)*cos(i)*20
z=tan(i)*10
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,20,10, crv)
#Lofting the curves
cmds.loft(myCurve)

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)

Clau_Ex 02B



#Exercise 02B
import maya.cmds as cmds
from math import*
from random import*
#from curves to surfaces
#1 Step: create a curve
def curves (amplitude):
#def initial variables
numPoints= 50
#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)*amplitude
y=cos(i)*amplitude/1.2
z= i
myPoint= (x,y,z)
#store the points in the list
points.append(myPoint)
myCurve=cmds.curve(d=3, p=points)
return myCurve

#create an empty list to store the curves
myCurve=[]
#define the number of curves
numCurves=20
#function to 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 (25,15,15, crv)
#loft the curves
cmds.loft(myCurve)

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)

Monday, May 25, 2009

02B - Diana Pérez - Math Function


#define initial variables
numPoints = 600
amplitude = 10

#loop and gather point information
for i in range (0, numPoints, 1):
#funtion for the curve
x = sin(i)*i
y = (cos(i)*sin(i))*i
z = i*amplitude/10
myPoint = (x, y, z)
cmds.spaceLocator (p = myPoint)(your code here)