Starfish Pattern 1

starfish try1

 


import rhinoscriptsyntax as rs</pre>
import math as mt

def makeLeg():
st = 0,0,0
ed = 5,15,0
CurveID = rs.AddLine(st,ed)
print CurveID

trans = 5,0,0
NewId = rs.CopyObject(CurveID,trans)
print NewId

st1 = 5,15,0
ed1 = 5,0,0
NewIdMirr = rs.MirrorObject(NewId, st1, ed1)

rs.MoveObject(NewIdMirr,trans)

def RotateLeg():
mylist = range(5)
for item in mylist:
crv = rs.AllObjects()
center = 0,5,0
angle = 45 * item
axis = 0,0,1
newCrv = rs.RotateObjects(crv, center, angle, axis, True)

def generateField():
xlist = range(3) # 0,1,2,3,...9
ylist = range(3)
for y in ylist:
for x in xlist:
legs = rs.AllObjects()
trans = x * 20, y * 20, 0
rs.CopyObjects(legs,trans)

def makeStarfish():
makeLeg()
RotateLeg()
generateField()

makeStarfish()

&nbsp;

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