Boya Zhang – Jan31

import rhinoscriptsyntax as rs
# Author: Boya Zhang
# Date: Jan 31, 2016
# Purpose: code practise

def addHead():
p0 = (0,11,0)
p1 = (-2,11,0)
p2 = (-7,10,0)
p3 = (-3,3,0)
points0 = p0,p1,p2,p3
curve0 = rs.AddCurve(points0,3)
start = (0,0,0)
end = (0,1,0)
rs.MirrorObject(curve0,start,end,True)
addHead()

def addLeg1():
p4 = (-3,3,0),(-6,1,0),(-15,0,0),(-10,-7,0),(-6,-6,0),(-2,-6,0),(-1,-6,0)
p5 = (-2,-9,0),(0,-7,0),(0,-4,0),(-7,-6,0),(-13,-1,0),(-4,-1,0),(0,1,0)
points1 = p4 + p5
curve1 =rs.AddCurve(points1)
start = 0,0,0
end = 0,1,0
rs.MirrorObjects(curve1,start,end,True)
addLeg1()

def addLeg2():
p6 = rs.GetPoints()
p7 = rs.GetPoints()
curve2 = rs.AddInterpCurve(p6,3)
curve3 = rs.AddInterpCurve(p7,3)
start = 0,0,0
end = 0,1,0
curve4 = curve2,curve3
rs.MirrorObjects(curve4,start,end,True)
addLeg2()

def main():
curve_id = rs.GetObjects()
if not curve_id: return
rs.EnableRedraw(False)
t = 0
while t<=1.0:
addpointat_r1_parameter(curve_id,t)
t+=0.02
rs.EnableRedraw(True)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s