Option Explicit '------------------------------------------------------------------------------------------- ' parametric description of Enneper surface ' x = u - u * u * u / 3 + u * v * v ' y = v - v * v * v / 3 + v * u * u ' z = u * u - v * v ' (from http://rsp.math.brandeis.edu/3D-XplorMath/Surface/enneper/enneper.html) ' Pablo Miranda Carranza, code released under GNU General Public License (www.gnu.org/licenses/gpl.txt) '------------------------------------------------------------------------------------------- 'With another equation, this script could draw any surface defined mathematically Sub Enneper() Dim i,j Dim stepsize Dim arrCount(1) 'this is for passing the Rhino.AddSrfControlPtGrid the number of u and v points Dim arrPoints(9999) '9999 because we are using u=100, v=100, u*v=100000, the index of the last point will be 9999 Dim nCount 'to keep track of the number of points stepsize=0.1 'size of the steps in the function arrCount(0) = 100 arrCount(1) = 100 nCount = 0 For i = 0 to arrCount(0) - 1 For j = 0 to arrCount(1) - 1 arrPoints(nCount) = calcenneper ( (i-50)*stepsize, (j-50)*stepsize) nCount = nCount + 1 Next Next Rhino.AddSrfControlPtGrid arrCount, arrPoints End sub function calcenneper(u,v) dim x,y,z x = u - u * u * u / 3 + u * v * v y = v - v * v * v / 3 + v * u * u z = u * u - v * v calcenneper=Array(x,y,z) end function 'we call the sub here so we don't have to run it (it will run at load) Enneper