Option Explicit Call Main() Sub Main() Const rhObjectPoint = 1 Dim strObject, arrCoordPoint Dim i, j, n: n=0 DIM o: o=0 Dim p: p=0 Dim strSrf Dim Udomain, Vdomain Dim arrPt, strTxt Dim Ustep, Vstep Dim intDivider Dim u, v, zspread, zz, zround, zcolor Dim vectNormal, arrPointNormal, strCoords, arrCoords Dim strLine Dim arrPlane Dim strCircle Dim arrCones Dim strMax, maxZ, minZ 'pick surface strSrf = Rhino.GetObject ("pick surface", 8) 'get surface domain Udomain = Rhino.SurfaceDomain (strSrf, 0) Vdomain = Rhino.SurfaceDomain (strSrf, 1) ' Call rhino.Print(UDomain(0) & "," & UDomain(1) ) ' Call rhino.Print(VDomain(0) & "," & VDomain(1)) ' 'get domain point ' Dim Umean, Vmean ' Umean = UDomain(0)+ (UDomain (1) - Udomain (0)) / 2 ' Umean = Round (Umean,2) ' Vmean = VDomain(0)+ (VDomain (1) - Vdomain (0)) / 2 ' Vmean = Round (Vmean,2) ' Call rhino.Print(Umean & "," & Vmean) 'step intDivider = 60 Ustep = (Udomain(1) - Udomain (0)) / IntDivider Vstep = (Vdomain(1) - Vdomain (0)) / IntDivider Call rhino.EnableRedraw (False) 'loop For i = 0 To intDivider For j = 0 To IntDivider u = Udomain (0)+ Ustep*i v = Vdomain(0)+ Vstep*j arrPt = rhino.EvaluateSurface (strSrf, array (u,v)) Call rhino.addpoint(arrPt) strCoords = rhino.addpoint(arrPt) arrCoords = Rhino.PointCoordinates (strCoords) ReDim Preserve Z(n) Z(n) = arrCoords(2) zz = arrCoords(2) 'Call Rhino.AddTextDot (zz, arrCoords) If n > 0 Then End If n = n+1 Next Next maxZ = Rhino.Max(z) Call Rhino.Print (maxZ & "maximum") minZ = Rhino.Min(z) Call Rhino.Print (minZ & "minimum") zspread = maxZ - minZ Call Rhino.Print (Zspread & "spread") 'loop For i = 0 To intDivider For j = 0 To IntDivider u = Udomain (0)+ Ustep*i v = Vdomain(0)+ Vstep*j arrPt = rhino.EvaluateSurface (strSrf, array (u,v)) Call rhino.addpoint(arrPt) strCoords = rhino.addpoint(arrPt) arrCoords = Rhino.PointCoordinates (strCoords) 'strObject = arrCoords 'arrCoordPoint = Rhino.PointCoordinates(strObject) 'Call Rhino.Print Rhino.Pt2Str(arrCoordPoint, 3) ' Call Rhino.AddTextDot (arrCoords(2),arrCoords) vectNormal = Rhino.SurfaceNormal (strSrf, array (u,v)) vectNormal = rhino.VectorScale (vectNormal, 200) ' arrPointNormal = Rhino.PointAdd (arrPt, vectNormal) zz = arrCoords(2) 'strLine = rhino.AddLine (arrPt, arrPointNormal) 'Call Rhino.CurveArrows (strLine ,2) arrPlane = Rhino.PlaneFromNormal (arrPt, vectNormal) 'Call Rhino.AddPlaneSurface (arrPlane, 40, 90) 'strCircle = rhino.AddCircle (arrPlane, 100/intDivider*(i+1)) 'Call Rhino.AddPlanarSrf ( array (strCircle) ) arrCones = Rhino.AddCone (arrPlane, 20,25, True) zcolor = ((zz - minZ)*(255/(maxZ-minZ))) zround = 50 * (Rhino.Floor(zcolor/50)) Call rhino.ObjectColor (arrCones, rgb (200,zround,0) ) Next Next Call rhino.EnableRedraw (True) End Sub