rvb Surface Circles

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 Main()

Sub Main()

Dim strSurface 'the surface

Dim uDiv,vDiv '

Dim arrUDomain, arrVDomain 

Dim Ustep, Vstep

Dim arrParameter

Dim arrPoint

Dim arrNormal, arrPlane, strCircle

Dim dblRadius  

Dim strPoints

Dim arrSurfaceDom

Dim arrData

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",10,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)

arrNormal = Rhino.SurfaceNormal (strSurface, arrParameter)

arrPlane = Rhino.PlaneFromNormal (arrPoint, arrNormal)

arrData = Rhino.SurfaceCurvature (strSurface, arrParameter)

If arrData (6) > 0 Then

dblRadius = arrData(6) * 30

strCircle = rhino.AddCircle(arrPlane,dblRadius)

Call rhino.AddPlanarSrf(array(strCircle))

End If



End Sub

Search Site

archi·o·logics survey

I am interested in: