Option Explicit
‘Script copyrighted by ben howell

Call Main()
Sub Main()
Const rhObjectMesh = 32
Dim strObject, arrVertices, arrVert, strObjPt, arrMeshes
Dim arrObjects

arrMeshes = Rhino.AllObjects
For Each strObject In arrMeshes
arrVertices = Rhino.MeshVertices(strObject)

Dim arrCentPt : arrCentPt = Rhino.MeshAreaCentroid(strObject)
‘Rhino.AddPoint arrCentPt
Dim dblDistance

If IsArray(arrVertices) Then
Dim n : n = 0
Dim x
For x = 0 To 1
ReDim Preserve newArrVertices(n)
ReDim Preserve newstrObj(n)
newArrVertices(n) = arrVertices(n)
dblDistance = Rhino.Distance(newArrVertices(n),arrCentPt)
‘Rhino.Print dblDistance
Rhino.RotateObject strObject, newArrVertices(0), (dblDistance* (rnd()*10))
n = n + 1
End If
End Sub


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 )

Google photo

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

Connecting to %s