Hyunchang Cho – rotating vase

Option Explicit
‘Script written by HyunChang Cho
‘Script copyrighted by team H
‘Script version Tuesday, October 28, 2008 10:34:18 PM
Call Cleareverything()
Call Main()
Sub Main()
 Dim arrPlane, i, j, strCrv(), strInnerCrv(), strSrf1, strSrf2, arrLftSrf1, arrLftSrf2, arrLftSrf3
 For j = 0 To 5
  For i = 0 To 10
   ReDim Preserve strCrv(i)
   ReDim Preserve strInnerCrv(i)
   arrPlane = Rhino.PlaneFromPoints (array(0,j*25,i*(j+2)), array(1,j*25,i*(j+2)), array(0,j*25+1,i*(j+2)))
   If i < j+3 Then
    strCrv(i) = Rhino.AddCircle (arrPlane, (15-i)/3)
    strInnerCrv(i) = Rhino.AddCircle (arrPlane, (15-i)/3-1)
    If i = 0 Then
     Call rhino.MoveObject (strInnerCrv(i),array(0,0,0),array(0,0,1))
    End If
   Else
    If i < 2*j Then
     strCrv(i) = Rhino.AddCircle (arrPlane, 2.0)
     strInnerCrv(i) = Rhino.AddCircle (arrPlane, 1.0)
    Else
    strCrv(i) = Rhino.AddCircle (arrPlane, i)
    strInnerCrv(i) = Rhino.AddCircle (arrPlane, i-1)
    End If
   End If 
   
   If i > 0 Then
    Call Rhino.MoveObject (strCrv(i), array(0,j*25,i*(j+2)), array(0,j*25+(j+2),i*(j+2)))
    Call Rhino.MoveObject (strInnerCrv(i), array(0,j*25,i*(j+2)), array(0,j*25+(j+2),i*(j+2)))
    Call Rhino.RotateObject (strCrv(i), array(0,j*25,i*(j+2)), 12*i*(j+1))
    Call Rhino.RotateObject (strInnerCrv(i), array(0,j*25,i*(j+2)), 12*i*(j+1))
   End If
         
   If i = 0 Then
    strSrf1 = Rhino.AddPlanarSrf (strCrv)
    strSrf2 = Rhino.AddPlanarSrf (strInnerCrv)
   End If
   If i = 10 Then
    arrLftSrf1 = Rhino.AddLoftSrf (array(strCrv(i),strInnerCrv(i)))
   End If
  Next
  arrLftSrf2 = Rhino.AddLoftSrf (strCrv,,,1)
  arrLftSrf3 = Rhino.AddLoftSrf (strInnerCrv,,,1)
  Call Rhino.JoinSurfaces (array(arrLftSrf1(0),arrLftSrf2(0),arrLftSrf3(0),strsrf1(0),strsrf2(0)),True)
  Call Rhino.deleteobjects (strCrv)
  Call Rhino.DeleteObjects (strInnerCrv)
 Next
End Sub

Sub Cleareverything()
 Call Rhino.Command(“SelAll”)
 Call Rhino.Command(“delete”)
End Sub

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