Tuesday, October 7, 2008

failed starbursts















I was attempting to create starburst-burst like forms along the division points by running the script a couple of times, but the 'rnd' never turned to a negative number so it did not turn out.

Option Explicit
'Script written by Caritina Mills
Call experiment()
Sub experiment()
Dim arrcurvepts(2), t, pi
pi=Rhino.pi()
For t=-7 To 7 Step .1
arrcurvepts(0)= t*Sin(3*t)
arrcurvepts(1)= t*Cos(3*t) arrcurvepts(2)= t
Call Rhino. addpoint(arrcurvepts)
Next
Dim pnts,pntsdelete
pnts=Rhino.getpointcoordinates("select points")
Call Rhino.AddInterpCurve (pnts)
pntsdelete=Rhino.getobjects("select all", 1,,,1)
Call Rhino.deleteobjects(pntsdelete)
Dim arrcyloriginal, arrref(1), arrend(1), arrdiv, strspiral,i, curve
strspiral=Rhino.GetObject("spiral")
arrdiv= Rhino.DivideCurve(strspiral, 50, True)
arrCyloriginal = Rhino.AddCylinder(Array(0,0,0), Array(0,0,2), 0.005)
For i=0 To UBound(arrdiv)
arrref(0) = Array(0,0,0)
arrref(1) = Array(0,0,.5)
arrend(0) = arrdiv(i)
arrend(1) = Array(Rnd*2,Rnd*3,Rnd)
Call Rhino.OrientObject(arrcyloriginal, arrref, arrend, True)
Next
Call Rhino.DeleteObject(arrcyloriginal)
pntsdelete=Rhino.getobjects("select all", 1,,,1)
Call Rhino.deleteobjects(pntsdelete)
End Sub

No comments: