Threefoil knot

The standard threefoil knot. This is a "sausage" mode rendering. To acheive this in PoV was somewhat hairy. Look at code below.

This is just clipped from a POV file I did to draw a knot

    //various constants
uumin = 0,uumax = 4*pi
vvmin = 0,vvmax = 2*pi
a=1, b=0.3, c=0.5, d=0.3
//preliminary calculations
r=a+b*cos(1.5*uu)
xx=r*cos(uu)
yy=r*sin(uu)
zz=c*sin(1.5*uu)
dx=-1.5*b*sin(1.5*uu)*cos(uu)-(a+b*cos(1.5*uu))*sin(uu)
dy=-1.5*b*sin(1.5*uu)*sin(uu)+(a+b*cos(1.5*uu))*cos(uu)
dz=1.5*c*cos(1.5*uu) //Derivatives
qn=vnormalize() //Vector operatons
qvn=vnormalize()
ww=vcross(qn,qvn)
//points and normals
x1=xx+d*(qvn.x*cos(vv)+ww.x*sin(vv)) //Calculate the
y1=yy+d*(qvn.y*cos(vv)+ww.y*sin(vv)) //points. ww.x is the
z1=zz+d*ww.z*sin(vv) //x value of ww vector
nx1=qvn.x*cos(vv)+ww.x*sin(vv) //Normals needed to
ny1=qvn.y*cos(vv)+ww.y*sin(vv) //make smooth triangles
nz1=ww.z*sin(vv)

Here is the PoV3-source I used

Back