Thad Nobuhara_ten2101_Vase

Option Explicit
‘Script written by TEN of the sscollective
‘Script version Tuesday, October 21, 2008 1:08:31 PM

Call Main()
Sub Main()
Dim arrPlane1, arrPlane2, i, j, strCrv(), strInnerCrv(), arrLftSrf1, arrLftSrf2, arrLftSrf3, arrLftSrf4, arrLftSrf5, arrLftSrf6, strSrf1, strSrf2, strSrf3
Dim intWidth1 : intWidth1  = RandomNumber(2,5)
Dim intWidth2 : intWidth2  = RandomNumber(5,10)
Dim intMatWidth : intMatWidth = .25
Dim intTopWid : intTopWid = intWidth2 – 2
For j = 0 To 5
For i = 0 To 10
ReDim Preserve strCrv(i)
ReDim Preserve strCrv2(i)
ReDim Preserve strCrv3(i)
ReDim Preserve strInnerCrv(i)
arrPlane1 = Rhino.PlaneFromPoints (Array(0,j*25,i*(j+1)+1), Array(1,j*25,i*(j+1)), Array(0,j*25+1,i*(j+1)))
arrPlane2 = Rhino.PlaneFromPoints (Array(0,j*25,i*(j+1)-1), Array(1,j*25,i*(j+1)), Array(0,j*25+1,i*(j+1)))
If i < 6 Then
strCrv(i) = Rhino.AddCircle (arrPlane1, intWidth1)
strInnerCrv(i) = Rhino.AddCircle (arrPlane1, intWidth1-intMatWidth)
End If
If i >= 6 And i<8 Then
strCrv(i) = Rhino.AddCircle (arrPlane2, intWidth2)
strInnerCrv(i) = Rhino.AddCircle (arrPlane2, intWidth2-intMatWidth)
End If
If i >=8 Then
strCrv(i) = Rhino.AddCircle (arrPlane1, intWidth1)
strInnerCrv(i) = Rhino.AddCircle (arrPlane1, intWidth1-1-intMatWidth)
End If
If i = 10 Then
strCrv(i) = Rhino.AddCircle (arrPlane2, 10)
strInnerCrv(i) = Rhino.AddCircle (arrPlane2, 9)
End If
If i = 0 Then
strSrf1 = Rhino.AddPlanarSrf (strCrv)
strSrf2 = Rhino.AddPlanarSrf (strInnerCrv)
End If
Next
arrLftSrf4 = Rhino.AddLoftSrf (strCrv,,,1)
arrLftSrf6 = Rhino.AddLoftSrf (strInnerCrv,,,1)
Call Rhino.deleteobjects (strCrv)
Call Rhino.DeleteObjects (strInnerCrv)
Next
End Sub
Function RandomNumber (nMin, nMax)

RandomNumber = Null

If Not IsNumeric(nMin) Then Exit Function
If Not IsNumeric(nMax) Then Exit Function

If nMin >= nMax Then Exit Function

Randomize

RandomNumber = Int((nMax – nMin + 1) * Rnd + nMin)

End Function

Advertisements

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 )

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