Tutorial Video

School of Architecture | University of Miami | Assistant Prof. Juhong Park

import rhinoscriptsyntax as rs import random def ArrangeHousing(): """Locates and Generates units from existing curves""" curveList = rs.GetObjects() x = 0.05 for curve in curveList: number = random.random() if number > 0.8: trans = [0,0,9] midCurve = rs.CopyObject(curve, trans) centroid = rs.CurveAreaCentroid(curve) origin = centroid[0] scale = [x,x,1] topCurve = rs.ScaleObject(curve, origin, scale, True) trans2 = [0,0,25 *number] rs.MoveObject(topCurve, trans2) ids = [curve, midCurve, topCurve] house = rs.AddLoftSrf(ids) rs.OffsetSurface(house, 5) x = x + 0.01 ArrangeHousing()

Posted in Assignments
Leave a comment

import rhinoscriptsyntax as rs

import math as mt

def lisacurve():

nlist= range(1 , 8)

for n in nlist:

anglelist = range( 0, 360)

crvList = []

ptlist = []

for angle in anglelist:

a = 1

b = 1

c = 1

t = mt.radians(angle)

x = a * mt.sin(n * t + c)

y = b * mt.sin(t)

ptposition = (x, y, mt.sin(angle))

pt = rs.AddPoint(ptposition)

ptlist.append(pt)

curve01 = rs.AddCurve(ptlist)

lisacurve()

Posted in Assignments
Leave a comment

import rhinoscriptsyntax as rs """LOOPS""" def forLOOP(): # USING XRANGE evens = [2,4,6,8] for even in evens: print even for x in xrange(8): print x for x in xrange(3,6): print x forLOOP() """while loops have boolean condition""" def whileLOOP(): count = 0 while count < 10: print count count += 1 if count >= 5: break """limts the outcome between 0-4""" whileLOOP()

def fib(): a, b = 2, 3 while 1: yield a a, b = b, a + b import types if type ( fib()) == types.GeneratorType: print "fib series." counter = 0 for n in fib(): print n counter += 1 if counter == 15: break

import rhinoscriptsyntax as rs def ArithmeticOperators (): number = 1 + 2 * 3 /2.0 print number remainder = 13 % 3 print remainder squared = 5 ** 2 print squared cubed = 2 ** 3 print cubed ArithmeticOperators () def LearnStrings(): hello = "hello" print hello manyhello = "hello" * 13 print manyhello Astring = "Hey Man." print len(Astring) """len(x) prints out the number of characters including punctuation""" print Astring.index("y") """ y is the second character """ print Astring.count("a") """ there is only one a character """ LearnStrings()