071018_M.Bearak_Meshing Test

Option Explicit
‘Script written by mark bearak
‘Script copyrighted by dtls.architecture
‘Script version Wednesday, October 17, 2007 12:19:11 PM

Call Main()
Sub Main()
Dim j, k, l, n
Dim arrStart, arrPoint, arrPlane
Dim dblLength : dblLength = 16
Dim dblHeight : dblHeight = 3
Dim Arrpta(), Arrptb(), Arrptc(), Arrptd()
Dim dblRadius : dblRadius = .2
j = 0
For k = 0 To 12
ReDim Preserve ArrPta(k), ArrPtb(k), ArrPtc(k), ArrPtd(k)
l = j
If (k Mod 2 = 0) Then
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l+.5,0), Array(k*dblLength,l,0), Array(k*dblLength,l+.5,1))
arrPta(k) = Rhino.AddCircle (arrPlane, dblRadius)
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l-.5,0), Array(k*dblLength,l,0), Array(k*dblLength,l-.5,1))
arrPtb(k) = Rhino.AddCircle (arrPlane, dblRadius)
Else
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l+.5,dblHeight),Array(k*dblLength,l,dblHeight), Array(k*dblLength,l+.5,dblHeight+1))
arrPta(k) = Rhino.AddCircle (arrPlane, dblRadius)
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l-.5,dblHeight),Array(k*dblLength,l,dblHeight), Array(k*dblLength,l-.5,dblHeight+1))
arrPtb(k) = Rhino.AddCircle (arrPlane, dblRadius)
End If
If (k Mod 2 = 1) Then
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l,dblHeight/2-.25), Array(k*dblLength,l+1,dblHeight/2-.25), Array(k*dblLength,l,dblHeight))
arrPtc(k) = Rhino.AddCircle (arrPlane, dblRadius)
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l,dblHeight/2+.25), Array(k*dblLength,l+1,dblHeight/2+.25), Array(k*dblLength,l,dblHeight))
arrPtd(k) = Rhino.AddCircle (arrPlane, dblRadius)
Else
If (k Mod 4 = 0) Then
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l-1.5,dblHeight/2-.25), Array(k*dblLength,l+3,dblHeight/2-.25), Array(k*dblLength,l-1.5,dblHeight))
arrPtc(k) = Rhino.AddCircle (arrPlane, dblRadius)
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l+1.5,dblHeight/2+.25), Array(k*dblLength,l+3,dblHeight/2+.25), Array(k*dblLength,l+1.5,dblHeight))
arrPtd(k) = Rhino.AddCircle (arrPlane, dblRadius)
Else
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l+1.5,dblHeight/2-.25), Array(k*dblLength,l+3,dblHeight/2-.25), Array(k*dblLength,l+1.5,dblHeight))
arrPtc(k) = Rhino.AddCircle (arrPlane, dblRadius)
arrPlane = Rhino.PlaneFromPoints (Array(k*dblLength,l-1.5,dblHeight/2+.25), Array(k*dblLength,l+3,dblHeight/2+.25), Array(k*dblLength,l-1.5,dblHeight))
arrPtd(k) = Rhino.AddCircle (arrPlane, dblRadius)
End If
End If
Next
Call Rhino.AddLoftSrf (arrPta)
Call Rhino.DeleteObjects (arrPta)
Call Rhino.AddLoftSrf (arrPtb)
Call Rhino.DeleteObjects (arrPtb)
Call Rhino.AddLoftSrf (arrPtc)
Call Rhino.DeleteObjects (arrPtc)
Call Rhino.AddLoftSrf (arrPtd)
Call Rhino.DeleteObjects (arrPtd)
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