#version 3.7;
global_settings { assumed_gamma 1.0 }
#macro Ring(A,R,T,O)
#for(i,0,359,45)
cylinder { ,vrotate(,22.5*z),R texture {T} rotate (i+O*45)*z}
cylinder { vrotate(,45*z),vrotate(,22.5*z),R texture {T} rotate (i+O*45)*z}
sphere { ,R texture {T} rotate (i+O*45)*z }
sphere { vrotate(,22.5*z),R texture {T} rotate (i+O*45)*z }
#end
#end
#macro First(A,R,T,S)
#for(i,0,359,45)
torus { S+R,R texture {T} translate rotate i*z}
#end
#end
#macro Last(A,R,T,O)
#for(i,0,359,45)
cylinder { ,vrotate(,45*z),R texture {T} rotate (i+O*45)*z}
#end
#end
#include "colors.inc"
#declare To=texture { pigment { color Red }}
#declare Te=texture { pigment { color White }}
#declare InitRad=1;
#declare Minor=0.06;
torus { InitRad+Minor,Minor texture { To }rotate 90*x}
#declare Thread=Minor/19;
camera { orthographic
location -10*z
direction z
up 2*(2*Minor+InitRad+Thread*2)*y
right 2*(2*Minor+InitRad+Thread*2)*x
rotate 4*z
}
First(InitRad,Thread,Te,Minor)
#for(j,0,clock)
Ring(InitRad,Thread,Te,j/2)
#declare InitRad = InitRad*0.79;
#end
Last(InitRad,Thread,Te,j/2)
light_source { <-3,-10,-30>,1 }