Point grid on surface by U.V.
From PDWiki
Revision as of 17:57, 14 November 2006; Kowala (Talk | contribs)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
(diff) ←Older revision | Current revision | Newer revision→ (diff)
Back to the Rhino Script Library
Option Explicit
Main
Sub Main()
Dim surface
surface = Rhino.GetObject( "Select a surface" )
If IsNull(surface) Then Exit Sub
Dim U
U = Rhino.getinteger( "How Many Points in U Direction?", 30 )
If IsNull(U) Then Exit Sub
Dim V
V = Rhino.getinteger( "How Many Points in V Direction?", 30 )
If IsNull(V) Then Exit Sub
Rhino.EnableRedraw vbFalse
Call Rhino.unselectallobjects( )
Call Rhino.selectobject( surface )
Call Rhino.command( "-_reparameterize 0 1 0 1" )
Dim i, j, m, pointArr, arrParam, uArr, vArr, arrDomV, arrPoint
Rhino.Print ("Calculating Points - Please Be Patient . . .")
For m = 0 To U - 1
uArr = m / ( U - 1 )
For j = 0 To V
vArr = j / V
arrPoint = Rhino.EvaluateSurface(surface, Array (uArr, vArr))
If IsArray(arrPoint) Then Rhino.AddPoint arrPoint
Next
Next
Rhino.EnableRedraw vbTrue
Rhino.Print ("Finished with " & CStr(U * V + U) & " Points")
End Sub
