final script

Call Main()
Sub Main()
Dim arrPlane, i,k, strCrv(), strInnerCrv(), strSrf(), arrX, arrPt(), arrInnerPt(), counter, arrHorzSurf(), arrVertSurf(), counter1, counter2, counter3
Dim strCrvv, strInnerCrvv, j, UnrolledSlice, dblDist, arrTempPt, arrTempInnerPt, strHorzSurf, strVertSurf, arrCrvs()
Dim intRandom, loopcounter

counter1 = 0
For loopcounter = 0 To 12
i = Random(2,13)
arrX = sin(i/15*3.14)*12
ReDim Preserve strCrv(counter1)
ReDim Preserve strInnerCrv(counter1)
ReDim Preserve strSrf(counter1)
ReDim Preserve arrHorzSurf(counter1)
arrPlane = Rhino.PlaneFromPoints (array(0,0,i), array(1,0,i), array(0,1,i))
strCrv(counter1) = Rhino.AddCircle (arrPlane, arrX)
strInnerCrv(counter1) = Rhino.AddCircle (arrPlane, arrX-1)
If i = 13 Then
arrHorzSurf(counter1) = Rhino.AddPlanarSrf (array(strCrv(counter1)))
arrHorzSurf(counter1) = Rhino.AddLoftSrf (array(strCrv(counter1),strInnerCrv(counter1)))
End If
counter1 = counter1 + 1
Call Rhino.DeleteObjects (strCrv)
Call Rhino.DeleteObjects (strInnerCrv)

counter2 = 0
For loopcounter = 0 To 5
intRandom = Random(20,120)
For j = -180 To 179 Step intRandom
ReDim Preserve arrVertSurf(counter2)
counter = 0
For i = 1 To 14
arrX = sin(i/15*3.14)*12
ReDim Preserve arrPt(counter)
ReDim Preserve arrinnerPt(counter)
arrTempPt = Rhino.Polar (array(0,0,0), j, arrX)
arrPt(counter) = array(arrTempPt(0),arrTempPt(1),arrTempPt(2)+i)
arrTempInnerPt = Rhino.Polar (array(0,0,0), j, arrX-1)
arrinnerPt(counter) = array (arrTempInnerPt(0),arrTempInnerPt(1),arrTempInnerPt(2)+i)
counter = counter + 1
strCrvv = Rhino.AddCurve (arrPt)
strinnerCrvv = Rhino.AddCurve (arrinnerPt)
arrVertSurf(counter2) = Rhino.AddLoftSrf (array(strCrvv, strInnerCrvv))
Call Rhino.DeleteObject (strCrvv)
Call Rhino.DeleteObject (strInnerCrvv)
counter2 = counter2 + 1

End Sub

Function Random(nMin, nMax)
Random = Int((nMax-nMin+1)*Rnd+nMin)
End Function


Leave a Reply

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

You are commenting using your 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 )

Google+ photo

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

Connecting to %s