Golden torus Fibonacci knots
Jump to navigation
Jump to search
// Persistence of Vision Ray Tracer Scene Description File // File: Groupkos.dev.geomagic_3-2_pattern_in_bifilar_13-8_torus_knots_800x600.pov // POV-Ray Vers: 3.7 RC7 win64 // Desc: Polyphase 13:8 torus knot group w/ colored halves (bifilar). // Auth: DonEMitchell -- a electrified knot group fanatic (XenoEngineer) // Edited: March 9, 2020 Revisited and reorganized for posting at groupkos.com/dev/category:povray // Edited: April 21, 2020 --added cylinder knot loop elements. // Edited: April 22, 2020 for groupkos/dev propagation animation // Edited: July 23, 2022 cleaned up for dev wiki posting. // Date: November 29, 2023 --chiral grouping illustration // -- HOW TO invoke an animation sequence -- // Put the control-code below into the POV-Ray text-box above the POV-Ray editor // (without the comment slashes). // Or from the menu: Render - Edit settings/Render. // Then click Run (Alt G). Search POV-Ray help for 'Animation'. // Or, right-click on the line below, and select "Copy [...] to the command line" // +SF1 +EF299 +KFI1 +KFF299 +W800 +H600 +A // The above POV-Ray control code causes POV-Ray to restart this file 299 times, // creating 299 image frames. // Each time the animation sequence runs, a variable named 'clock' is advanced // from zero to one (0-1). // The clock variable is used below to modulate parameters affecting the rendering. // Note: POV-Ray does not generate an animated GIF, which is done with external utility. #version 3.7; #include "colors.inc" global_settings { max_trace_level 10 // Reflection levels before blackness. assumed_gamma 1.2 charset utf8 // Used in global_settings, sets an overall brightness/ambient light level in the scene ambient_light color rgb <1,1,1> * .5 } #default{ finish{ ambient .5 diffuse 0.5 }} sky_sphere{ pigment { gradient <-1,1,-1> color_map { [0.00 rgb <0.6,0.7,0.80>*.2] [0.35 rgb <0.0,0.1,0.8>*.2] [0.65 rgb <0.0,0.1,0.8>*.2] [1.00 rgb <0.6,0.7,1.0>*.2] } scale 2 } // end of pigment } //--------------------------- Macros --------------------------------- // Axes macro: length and radii of axes, and boolean flags to include/exclude axes #macro axes(length, radii, X, Y, Z) #if (X) cylinder{ 0, < length, 0, 0>, radii texture { pigment { color rgb < .75,-.1,-.1 > }}} #end // X axis, red #if (X) cylinder{ 0, <-length, 0, 0>, radii texture { pigment { color rgbt < 1, 0, 0, .6 > }}} #end // -X axis red translucent -adjust xmit #if (Y) cylinder{ 0, < 0, length/2, 0>, radii texture { pigment { color rgb < -.1, .75,-.1 > }}} #end // Y axis, green #if (Y) cylinder{ 0, < 0, -length/2, 0>, radii texture { pigment { color rgbt < 0, .8, 0, .6 > }}} #end // Y axis, green translucent #if (Z) cylinder{ 0, < 0, 0, length>, radii texture { pigment { color rgb < 0, 0, 2 > }}} #end // Z axis, Blue #if (Z) cylinder{ 0, < 0, 0, -length>, radii texture { pigment { color rgbt < .1, .1, .4, .6 > }}} #end // -Z axis blue translucent #end //macro axes() #macro torusKnotBifilar(objectBifilarA, objectBifilarB, objLugA, objLugB, radiusConductor, radiusConnector, major, minor, poloid, toroid, polyphase, delta) union{ // Render objectBifilarA and B as connector lugs object{objLugA translate x*(major+minor+radiusConnector*0)} // Render a objectBifilarB as a connector lug object{objLugB translate -x*(major+minor+radiusConnector*0)} // Draw both bifilar objects in one loop from zero through 180 degrees. #local n = 0; // n Is the while loop index. // The clock variable modulates completion length of while loop to animate propagation of bifilar halves. #while (n <= (180 * poloid * clock)) // Loop positive 180 degrees, and draw the objectBifilarB, below, looping the negative 180. #local phaz = n * toroid/poloid; // Divide out poloid (multiplied already into n) to obtain toroidal rotation. // 1st Bifilar half as objectBifilarA #if( 01 ) object{ objectBifilarA // Move the objectBifilar away from the origin on the X axis by the minor radius. translate x*minor // Toroidally rotate objectBifilar around Z axis in the XY plane. rotate <0,0,phaz> // Move the rotated objectBifilar the distance of the major radius in the X-axis. translate x*major // Rotate the object about the center Y axis of the torus. rotate y*n } #end #if( 01 ) object{ objectBifilarB // Move the objectBifilar away from the origin on the X axis by the minor radius. translate x*minor // Toroidally rotate objectBifilar around Z axis in the XY plane. rotate <0,0,phaz> // Move the rotated objectBifilar the distance of the major radius in the X-axis. translate x*major // Rotate the object about the center Y axis of the torus. rotate y*n rotate y*180 } #end // Counter-toroid #if( 0 ) object{ objectBifilarA // Move the objectBifilar away from the origin on the X axis by the minor radius. translate x*minor // Toroidally rotate objectBifilar around Z axis in the XY plane. rotate <0,0,-phaz> // Move the rotated objectBifilar the distance of the major radius in the X-axis. translate x*major // Rotate the object about the center Y axis of the torus. rotate y*n } #end // 2nd Bifilar half as objectBifilarB (counter-toroid and counter-poloid rotations) #if( 0 ) object{ objectBifilarB // Move the objectBifilar away from the origin on the X-axis by the minor radius. translate x*minor // Toroidally Counter-rotate objectBifilarB around Z-axis in the XY-plane. rotate <0,0,-phaz> // Move the rotated objectBifilar the distance of the major radius in the X-axis. translate x*major // Counter-rotate the objectBifilarB about the center Y-axis of the torus. rotate -y*n rotate -y*(180) } #end #if(showQuadrantConnectors) sphere{ 0,radiusConnector translate x*(radiusMinor + radiusMajor) rotate y*90 texture { pigment{rgbt<1,1,0,.0975>} } } sphere{ 0,radiusConnector translate x*(radiusMinor + radiusMajor) rotate -y*90 texture { pigment{rgbt<1,1,0,.0975>} } } #end #local n = n + delta; #end // while rotate y*polyphase // Rotate the completed knot to its phase-angle about the torus center Y-axis. } // end union #end // macro torusKnotBifilar() // ----------------- Optics -------------------- camera { //orthographic //location <2*27-27*clock,8,0> location z*28 look_at y*0 angle 58 sky y right x*image_width/image_height } // general light definition light_source { <15, 10, 10> // position of the light source color rgb 1.0*3 // color of the light shadowless } // ---------------- Scene ------------------------ // 13/8 = 1.625 // Phi = 1.6180339887498948482045868343656 // Difference = 1.625 - Phi // Difference = 0.00696601125010515179541316563436 // Torus knot parameters (loop/twist) // #declare poloid = 3; #declare toroid = 2; //#declare poloid = 12 + 1*clock; // clock sequences from 0 to 1 //#declare toroid = 8; #declare phaseCount = 1; // Delta as increment between objects tracing torus loop in the torus knot macro. // The knot is a string of overlapping spheres. Delta sets the separation. #declare plotDelta = .05; // Torus dimensions // Torus parameters and knot ratio (winding number) construct a 'golden orthogonal (ish) Fibonacci torus knot' (GOFTK) // FTK: Neighboring Fibonacci-sequence numbers (1,1,2,3,5,8,13,21...) // Poloidal rotations = Fn+1 // Toroidal rotations = Fn // Torus knot ratio: (Fn+1)/(Fn) = golden ratio (almost) --The knot ratio approximates Phi = 13/8 = 1.6025 #declare Phi = pow(5,.5) * .5 + .5; // Upper case Phi = 1.618... #declare PhiIndex = 4; // Set the radix of Phi for the major radius. // Calculate orthogonal major/minor radii. #declare radiusMajor = pow(Phi, PhiIndex ); #declare radiusMinor = radiusMajor-pow(Phi, PhiIndex - 4 ); // Four degrees of Phi smaller. #declare ySquash = 1; #declare radiusConnector = .75; #declare radiusConductor = .15; #declare showConnectors = 0; #declare showQuadrantConnectors = 0; // Toggle parts of the scene. #declare showBaseTorus = 10; #declare showTorusKnots = 01; #declare showAxes = 0; #declare axesRadius = 0.1; #declare colorA = Green*.5; #declare colorB = Orange*.5; // Center objects on the origin for passing to the macro #declare objA = sphere{0, radiusConductor texture{pigment{color colorA}}}; #declare objB = sphere{0, radiusConductor texture{pigment{color colorB}}}; #declare objLugA = sphere{ 0, radiusConnector texture{pigment{color colorA }} } #declare objLugB = sphere{ 0, radiusConnector texture{pigment{color colorB }} } union{ // Bifilar torus knots. #if(showTorusKnots) #local phaseAngle = 360/phaseCount; #local j = 0; // While-loop index // Render multiple bifilar phases rotated apart by multiples of phaseAngle // union{ #while(j < phaseCount) // Call torus knot macro // torusKnotBifilar ( objA, objB, objLugA, objLugB, radiusConductor, radiusConnector, major, minor, poloid, toroid, polyphase, delta) torusKnotBifilar ( objA, objB, objLugA, objLugB, radiusConductor, radiusConnector, radiusMajor, radiusMinor, poloid, toroid, j*phaseAngle, plotDelta) //object{torusKnotBifilar ( objA, objB, objLugA, objLugB, radiusConductor, radiusConnector, radiusMajor, radiusMinor, poloid, toroid, j*phaseAngle, plotDelta) rotate -y*90} #declare j = j + 1; // Increment loop index #end scale y*ySquash //clipped_by{plane{-x,0}} } #end // Moebius bifilar torus knots. #if(showBaseTorus) torus{ radiusMajor,radiusMinor *.9994 texture { pigment{rgbt<1,1,0,.985>} } //texture { pigment{rgbt<1,1,1,.07> } } //clipped_by{plane{z,0}} scale y*ySquash } #end #if(showAxes) axes(radiusMajor+radiusMinor*1.0, axesRadius,1,1,1) #end } // end scene union{}