Monday, November 26, 2007

orientCurve














The following is the script to construct this mess. I modeled a polygon lattice in Maya with multiple deformer. In Rhino, the script allows me to select those lines in order to lay them out. I printed those lines and cut wood sticks accordingly.

NO measuring! Saved my ass.














Option Explicit
Sub orientCurve

Dim strLine, i, arrReference, arrTarget
Dim strCurveS, strCurveE, strTarget1, strTarget2
i = 4

Do

'select lines in order
strLine = Rhino.GetObject ("select a line", 4)

'orient lines
strCurveS = Rhino.CurveStartPoint (strLine)
strCurveE = Rhino.CurveEndPoint (strLine)

arrReference = Array (strCurveS,strCurveE)
strTarget1 = Array (0,-i, 0)
strTarget2 = Array (99999,-i, 0)
arrTarget = Array (strTarget1,strTarget2)

i = i + 0.25
Call Rhino.OrientObject (strLine, arrReference, arrTarget)

Loop

End Sub
orientCurve