Option Explicit
‘Script written by Adolfo Nadal
‘Script copyrighted by Archiologics
‘Script version Thursday, November 20, 2008 1:10:35 AM
Call Main()
Sub Main()
Dim line
Dim strtPt
Dim endPt
Dim arrEditPts
Dim arrLines : arrLines = Rhino.GetObjects (“lines”,4)
Dim scalefactor
Rhino.EnableRedraw False
For Each line In arrLines
strtPt = Rhino.CurveStartPoint(line)
endPt = Rhino.CurveEndPoint(line)
scalefactor = -0.35*ArbitraryValue(1,1.3)
Dim h : h = Rhino.CurveLength (line)
’Rhino.Print h
’strtPt(0) = strtPt(0)’ + 0.5*h*scalefactor’*(-1)^(2*Int(ArbitraryValue(0,2)))
’strtPt(1) = strtPt(1)’ + 0.5*h*scalefactor’*(-1)^(2*Int(ArbitraryValue(0,2)))
strtPt(2) = strtPt(2) + h*scalefactor
’endPt(0) = endPt(0)’ + 0.5*h*scalefactor’*(-1)^(2*Int(ArbitraryValue(0,2)))
’endPt(1) = endPt(1)’ + 0.5*h*scalefactor’*(-1)^(2*Int(ArbitraryValue(0,2)))
endPt(2) = endPt(2) + h*scalefactor
arrEditPts = Rhino.CurveEditPoints(line)
arrEditPts(0) = strtPt
arrEditPts(Ubound(arrEditPts)) = endPt
Rhino.DeleteObject(line)
Rhino.AddInterpCurve(arrEditPts)
Next
Rhino.EnableRedraw True
End Sub
Function arbitraryValue(min, max)
Randomize
arbitraryValue = min + (max – min) * Rnd
End Function
0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.