Bound to the ground

This is the original v.0.1 script. It will eventually crash if the original curve is very intricate (the curves created by the script will become shorter than the tolerance returning a “string required” error…

Anyway, here is the code:

Option Explicit

‘Script written by Ado

Call Main()
Sub Main()
Dim arrStartPt()
ReDim Preserve arrStartPt(0)
arrStartPt(0) = Rhino.GetPoint (“select start point”)
Dim strCrv : strCrv = Rhino.GetObject (“select boundary curve”, 4)
Dim i, j, l, arrNewPt, strTempLn, arrCCX, arrNewTempPt, strNewLine, dblCrvLength
Dim dblAngle : dblAngle = 10
Dim k : k = 10
For j = 1 To 100
ReDim Preserve arrStartPt(j)
arrNewPt = Rhino.Polar (arrStartPt(j-1), k, 10000)
strTempLn = Rhino.addLine (arrStartPt(j-1),arrNewPt)
arrCCX = Rhino.CurveCurveIntersection (strTempLn, strCrv)
If arrCCX(i,0) = 1 Then
arrNewTempPt = arrCCX(0,1)
End If
Call Rhino.DeleteObject (strTempLn)
strNewLine = Rhino.AddLine (arrStartPt(j-1),arrNewTempPt)
dblCrvLength = Rhino.CurveLength (strNewLine)
k = k + (134 – dblCrvLength)
strNewLine = Rhino.ScaleObject (strNewLine,arrStartPt(j-1),array(0.9,0.9,0.9))
arrStartPt(j) = rhino.CurveEndPoint (strNewLine)
Dim arrNewStartPt()
For l = 0 To UBound(arrStartPt)
ReDim Preserve arrNewStartPt(l)
arrNewStartPt(l) = array(arrStartPt(l)(0),arrStartPt(l)(1),arrStartPt(l)(2)+(l*10))
Call Rhino.AddCurve (arrNewStartPt)
End Sub

Bound to the ground 1


Leave a Reply

Fill in your details below or click an icon to log in: Logo

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