rvb Surface Parameter Viewer

rvb animation snippet example

Another easy to use example on surface parameters. This time we will create circles depending on the position relative to surface parameters.

Option Explicit

'Script written by Adolfo Nadal

'Script by archiologics · www.archiologics.com

 

Call SurfaceUV()

Sub SurfaceUV()

Dim strSurface 'the surface

Dim uDiv,vDiv '

Dim arrUDomain, arrVDomain 

Dim Ustep, Vstep

Dim arrParameter

Dim arrPoint

 

strSurface = rhino.getobject ("please pick surface",8, vbTrue)

   

uDiv = rhino.GetInteger("please enter number in U-direction",5,1)

vDiv = rhino.GetInteger("please enter number in V-direction",5,1)

 

arrUDomain = rhino.SurfaceDomain (strSurface, 0)

arrVDomain = rhino.SurfaceDomain (strSurface, 1)

 

UStep = (arrUDomain(1)-arrUDomain(0)) / uDiv

Vstep = (arrVDomain(1)-arrVDomain(0)) / vDiv

 

Dim u,v

For u = 0 To uDiv

For v = 0 To vDiv

arrParameter = Array(arrUDomain(0)+ UStep * u, arrVDomain(0)+ VStep * v)

arrPoint =rhino.EvaluateSurface(strSurface,arrParameter)

Call rhino.AddPoint(arrPoint)

Call UVTextDot(arrParameter,arrPoint)

Next

Next

End Sub

 

Function UVTextDot(arrParameter,arrPoint)

Dim StrUVString

Dim dblU, dblV

dblU = arrParameter(0)

dblV = arrParameter(1)

dblU = round(dblU,2)

dblV = round(dblV,2)

StrUVString = "U " & dblU & " - V " & dblV

UVTextDot = rhino.AddTextDot(strUVString, arrPoint)

End Function

 

Search Site




archi·o·logics survey

I am interested in: