## # Limpet torus # p01 2010 # Maya python script ## from math import sin, cos, pi, sqrt from maya.cmds import curve, ls, loft, delete width = 1 height = 1 length = 1 uRes = .3 vRes = .2 cvs = [] u = -pi while u <= pi : pts = [] v = -pi while v <= pi : x = cos(u) / (sqrt(width+1) + sin(v)) y = sin(u) / (sqrt(height+1) + sin(v)) z = (length+1) / (sqrt(length+1) + cos(v)) pts.append((x, y, z)) v += vRes u += uRes curve(p=pts) cv = ls(sl=1) cvs.append(cv[0]) loft(cvs, c=1) delete(cvs)