Tuesday, October 27, 2009

Rhino: Scripting


Function towertower
Dim rect
Dim rect_height
Dim floors_cap

Dim i
Dim strObject
Dim arrStart
Dim arrEnd
Dim floor_copied
Dim x
Dim origin
Dim scale_floor


rect = Rhino.GetObject ("select rectangle")
rect_height = Rhino.GetReal ("thickness of volume", .5)
floors_cap = Rhino.ExtrudeCurveStraight (rect, Array(0,0,.01), Array(0, 0, rect_height))
Rhino.CapPlanarHoles floors_cap
'-------------------------------

'copy object

For i = 1 To 50
x=rect_height
origin = Array(0,0,0)
floor_copied = Rhino.GetObject("Select object to copy")
'startpoint = Rhino.GetPoint("Point to copy from")
endpoint = Array(0,0,1*x)
'endpoint = Rhino.GetPoint("Point to copy to", origin)
room = Rhino.CopyObject(floor_copied, origin, endpoint)
Rhino.RotateObject room, origin, Rnd*15, ,False
Next
'-------------------------------

For i = 1 To 30

scale_floor = Rhino.GetObject ("select an object to scale")
point = Rhino.SurfaceVolumeCentroid(scale_floor)
Call Rhino.AddPoint(point(0))
Call Rhino.ScaleObject(scale_floor, point(0), Array(Rnd+1,Rnd+1,1), False)
Next

End Function

Call towertower

No comments:

Post a Comment