Showing posts with label Valentina. Show all posts
Showing posts with label Valentina. Show all posts

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

Assingnment 01B - 3D GRID










import maya.cmds as cmds
#3d points grid
from math import*
numRows = 50
numColumns = 10
num3rdDimension =40
for i in range(0,numRows,3):
x = (i)
for j in range(0,numColumns,1):
y = j
for k in range(-1,num3rdDimension,1):
z = sin(k*i*j)
myPoint=(x,y,z)
cmds.spaceLocator(p=myPoint)

Monday, June 8, 2009

Assingnment 01B - Points to curves



import maya.cmds as cmds
from math import*
from random import*
######################################################
#from points to curves
#defining initial variables
numRows= 30
numColumns=3
numLevels=9
amplitude = 7
#create an empty list to store the points
points= []
#defining the loop and gather information
for i in range (-1,numRows,1):
x= sin(6*i)*amplitude
for j in range (-1,numColumns,2):
y= cos(i)*8
for k in range (0,numLevels,2):
z= k+1
myPoint=(x,y,z)
#store the point in the list
points.append(myPoint)
#create the curve
cmds.curve (d= 3, p= points) #curve degree 3

Assignment 01 A Pseudo Code

for humans

boil the water
put rice in the water
wait 20 min

for computer

function boilWater:
with waterBoiler
fill with coldWater
if waterBoiler = full:
stop fill
turn waterBoiler.switch to „on“
when waterBoiler.switch = „off“:
execute function fillPot

function fillPot:
get pot
place pot right to waterBoiler
with waterBoiler:
move 30cm up
turn -90°
if pot = „full“
with waterBoiler:
turn 90°
move 15cm down
execute function makeRice

function makeRice:
desiredRice = 200
desiredTime = 20min
get rice
with rice:
place inside pot

start counting time
if time = 20min:
put pot in initial position
when waterBoiler.switch = „off“:
finish