#version 3.8; global_settings { assumed_gamma 1 } default { finish {ambient 0.0} } #declare Grey50 = srgb <0.5,0.5,0.5>; background { color Grey50 } #declare Camera00 = camera { perspective location <2,2,-3.001> sky y angle 35 right x*(image_width/image_height) look_at <0,0,0> } #declare VarOrthoMult = 3.3/max(image_width/image_height, image_height/image_width); #declare Camera01z = camera { orthographic location <0,0,-2> direction z right VarOrthoMult*x*max(1,image_width/image_height) up VarOrthoMult*y*max(1,image_height/image_width) } #declare Camera01y = camera { orthographic location <0,2,0> direction -y right VarOrthoMult*x*max(1,image_width/image_height) up VarOrthoMult*z*max(1,image_height/image_width) } #declare Camera01x = camera { orthographic location <2,0,0> direction -x right VarOrthoMult*z*max(1,image_width/image_height) up VarOrthoMult*y*max(1,image_height/image_width) } #declare White = srgb <1,1,1>; #declare Light00 = light_source { <50,150,-250>, White } #declare Red = srgb <1,0,0>; #declare CylinderX = cylinder { -1*x, 1*x, 0.01 pigment { Red } } #declare Green = srgb <0,1,0>; #declare CylinderY = cylinder { -1*y, 1*y, 0.01 pigment { Green } } #declare Blue = srgb <0,0,1>; #declare CylinderZ = cylinder { -1*z, 1*z, 0.01 pigment { Blue } } #declare Vrx = 0.1; #declare Vry = 0.1; #declare Vrz = 0.1; #declare VrAx = 1.0/Vrx; // Major radius in x dived by Vrx. #declare VrBy = 0.5/Vry; // Major radius in x dived by Vrx. #declare VrE1 = 1.0; // Flat / Sharp #declare VrE2 = 1.0; // Square or Diamond path #declare VrMajorR = max(Vrx+VrAx,Vry+VrBy,Vrz); // Could be coded more consisely... #declare FnSignCosu = function (u) { ((cos(u)<0.0)*-1)+((cos(u)>=0.0)*+1) } #declare FnSignSinu = function (u) { ((sin(u)<0.0)*-1)+((sin(u)>=0.0)*+1) } #declare FnSignCosv = function (v) { ((cos(v)<0.0)*-1)+((cos(v)>=0.0)*+1) } #declare FnSignSinv = function (v) { ((sin(v)<0.0)*-1)+((sin(v)>=0.0)*+1) } #declare FnAbsCosu = function (u) { abs(cos(u)) } #declare FnAbsSinu = function (u) { abs(sin(u)) } #declare FnAbsCosv = function (v) { abs(cos(v)) } #declare FnAbsSinv = function (v) { abs(sin(v)) } #declare FnX = function (u,v) { Vrx * (VrAx + FnSignCosu(u) * pow(FnAbsCosu(u),VrE1)) * FnSignCosv(v) * pow(FnAbsCosv(v),VrE2) } #declare FnY = function (u,v) { Vry * (VrBy + FnSignCosu(u) * pow(FnAbsCosu(u),VrE1)) * FnSignSinv(v) * pow(FnAbsSinv(v),VrE2) } #declare FnZ = function (u,v) { Vrz * FnSignSinu(u) * pow(FnAbsSinu(u),VrE1) } #declare Para99 = parametric { function { FnX(u,v) } function { FnY(u,v) } function { FnZ(u,v) } <-pi,-pi>, contained_by { box { <-VrMajorR*2.2,-VrMajorR*2.2,-VrMajorR*2.2>, } } // Sloppy accuracy 0.0005 max_gradient 0.001 precompute 18, x,y,z pigment { color Green } } //--- scene --- camera { Camera00 } light_source { Light00 } object { CylinderX } object { CylinderY } object { CylinderZ } // camera { Camera01x } // camera { Camera01y } // camera { Camera01z } object { Para99 }