Option Explicit
‘Script written by Adolfo Nadal
‘Script copyrighted by Archi-o-logics
‘Script version Monday, October 20, 2008 4:50:16 PM
Call Main()
Sub Main()
Dim strDest, arrDest, strLoc, strLocs, arrPt, arrLoc, i,j, dblDist, dblNewDist, arrClosePt, strTempLine, strTempLine2,strTempLine3,strTempLine4, arrMidPt, arrMidPt2, arrMidPt3, arrNewPts, arrNewPts2, arrNewPts3, arrNewPt
arrDest = Rhino.GetObjects (“select your destinations”,1)
strLocs = Rhino.GetObjects (“select your acticator”,1)
Dim factor : factor = 6
For Each strLoc In strLocs
arrLoc = rhino.PointCoordinates (strLoc)
dblDist = 100000
For i = 0 To Ubound(arrDest)
arrPt = rhino.PointCoordinates (arrDest(i))
dblNewDist = Rhino.distance (arrLoc, arrPt)
If dblNewDist < dblDist Then
dblDist = dblNewDist
arrClosePt = arrPt
End If
Next
strTempLine = Rhino.AddLine (arrLoc,arrClosePt)
arrMidPt = Rhino.CurveMidPoint (strTempLine)
strTempLine2 = Rhino.CopyObject (strTempLine)
strTempLine3 = Rhino.AddLine(arrLoc,arrMidPt)
arrMidPt2 = Rhino.CurveMidPoint (strTempLine3)
strTempLine4 = Rhino.AddLine(arrClosePt,arrMidPt)
arrMidPt3 = Rhino.CurveMidPoint (strTempLine4)
Call Rhino.ScaleObject (Rhino.RotateObject (strTempLine2, arrMidPt,90),arrMidPt,array(rnd(0.5),rnd(0.5),rnd(0.5)))
arrNewPts = Rhino.DivideCurve (strTempLine2,10)
Call Rhino.ScaleObject (Rhino.RotateObject (strTempLine3, arrMidPt2,90),arrMidPt2,array(rnd(0.5),rnd(0.5),rnd(0.5)))
arrNewPts2 = Rhino.DivideCurve (strTempLine3,10)
Call Rhino.ScaleObject (Rhino.RotateObject (strTempLine4, arrMidPt3,90),arrMidPt3,array(rnd(0.5),rnd(0.5),rnd(0.5)))
arrNewPts3 = Rhino.DivideCurve (strTempLine4,10)
For j = 0 To ubound(arrNewPts)
Dim z : z = factor * Abs(sin (180*j/ubound(arrnewPts)))
If j< ubound(arrNewPts) Then
Call Rhino.AddInterpCurve (array(rhino.CurveStartPoint (strTempLine),arrNewPts2(j),array(arrNewPts(j)(0),arrNewPts(j)(1),arrNewPts(j)(2)+z),arrNewPts3(j),rhino.CurveEndPoint(strTempLine)))
‘Call Rhino.AddInterpCurve (array(rhino.CurveStartPoint (strTempLine),array(arrNewPts(j)(0),arrNewPts(j)(1),z),rhino.CurveEndPoint (strTempLine)))
End If
Next
Call Rhino.deleteobject (strTempLine)
Call Rhino.deleteobject (strTempLine2)
Next
End Sub
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.