Monday, April 23, 2012

spiraling around a spiral



import rhinoscriptsyntax as rs
import math

ptLt=[]

for i in range (10):
    x=math.cos(i)
    y=math.sin(i*1)
         z=i
    ptS=rs.AddPoint([x,y,z])
    ptLt.append(ptS)

crv=rs.AddInterpCurve(ptLt)
framest=[[0,0,0],[1,0,0],[0,1,0]]
t=9
endpts=[]

for i in range (t+1):
    line=rs.AddLine([0,0,0],[math.cos(math.pi/2*i),math.sin(math.pi/2*i),0])
         p=i/t
    par=rs.CurveParameter(crv,p)
    fra=rs.CurvePerpFrame(crv,par)
    frame=[fra[1],fra[2],fra[3]]
    eva=rs.EvaluateCurve(crv,par)
    orobj=rs.OrientObject(line,framest,frame,1)
    rs.MoveObject(orobj,rs.VectorCreate([0,0,0],rs.CurveStartPoint(orobj)))
    vect=rs.VectorCreate([0,0,0],eva)
    mvobj=rs.MoveObject(orobj,eva)
    enpt=rs.CurveEndPoint(mvobj)
    endpts.append(enpt)

newcrv=rs.AddInterpCurve(endpts)
 

No comments:

Post a Comment