Option Explicit 'Script written by Ted Ngai Sept 2006 - www.tedngai.net 'This work is licensed under a Creative Commons Attribution-Share Alike 3.0 United States License. 'http://creativecommons.org/licenses/by-sa/3.0/us/ Call Main() Sub Main() Dim Pi : Pi = 4 * Atn(1) Dim arrPoints Dim u, v, maxV, maxU : maxV = 60 : maxU = 12 Dim r, a, b, m, n, k : k = 2 Dim x,y,z,xt,yt,zt Call Rhino.EnableRedraw(False) For v = 0 To maxV-1 For u =-maxU/2*Pi To maxU/2*Pi Step Pi/32 If v Mod 2 = 0 Then xt=u*2 yt=Cos(4*u)/2+v zt=Cos(4*u)/2+v ElseIf v Mod 2 = 1 Then xt = u*2 yt=Cos(4*u+Pi)/2+v zt=Cos(4*u+Pi)/2+v End If 'Change equation here --------------------------------- 'x=xt 'y=yt 'z=zt If IsArray(arrPoints) Then ReDim Preserve arrPoints( UBound(arrPoints) + 1 ) Else ReDim arrPoints(0) End If arrPoints(UBound(arrPoints))= Array(x,y,z) Next Rhino.AddCurve(arrPoints) arrPoints = vbNull End If Next Call Rhino.EnableRedraw(True) End Sub