Option Explicit
'Script written by …•VitrartiV•…
'Date martedì 6 febbraio 2009 21.02.40
Sub Main()
Dim strc:strc=rhino.GetObject("select a close curve",4)
If isnull (strc) Then Exit Sub
Dim intN:intN=rhino.getinteger("how many samples",100,50,5000)
If isnull (intN) Then Exit Sub
Dim arrdom:arrdom=rhino.CurveDomain(strc)
Dim i, dblstep, dblpar, arrcrvdata, intcount
Dim arrline, strline, arrcircle,arrplane,dblrad
Call rhino.EnableRedraw(False)
intcount=0
ReDim arrcircle(intn)
dblstep=(arrdom(1)-arrdom(0))/intN
For i =0 To intN
dblpar=arrdom(0)+i*dblstep
arrcrvdata=rhino.CurveCurvature(strc,dblpar)
arrplane=rhino.CurvePerpFrame(strc,dblpar)
If Not isnull (arrcrvdata) Then
dblrad=1000/arrcrvdata(3)
Else
dblrad=0.1
End If
arrcircle(i)=rhino.AddCircle(arrplane,dblrad)
Call rhino.ObjectColor(arrcircle(i),rgb(255*sin(i*Pi/intN),255*sin(i*Pi/intN),255))
Next
Call rhino.EnableRedraw(True)
Dim arrcrvs
arrcrvs= rhino.AddLoftSrf(arrcircle)
End Sub
Call Main()
6.2.09
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment