- Contents in this wiki are for entertainment purposes only
Dev:P5.js Tori knots platonics interference and misc
Jump to navigation
Jump to search
Sketch of a n-tori on a donut using arrayed points drawn with cylinders between points
This approach uses pre-calculated points along a torus knot curve, with interconnecting cylinders (to reduce point count and render faster).
This file is GPT generated to conform as a compatible design that a can be realized in P5.js or POVRay either.
// PoVRay 3.7 Scene File " lightSpeed.pov"
// author: Assistant XenoEngineer (Chat GPT 4.0)
// prompter: XenoEngineer@groupKOS.com
// date: 12.31.2023
#version 3.7;
global_settings{ assumed_gamma 1.15 }
#default{ finish{ ambient 0.125 diffuse 1.2 }}
#include "colors.inc"
#include "textures.inc"
#macro Axis_(PointTo, AxisLen, axesRadius, Dark_Texture, Light_Texture)
union{
cylinder {
PointTo*AxisLen, -PointTo*AxisLen
axesRadius
texture{ checker texture{Dark_Texture} texture{Light_Texture} translate<0.1,0,0.1> }
}
cone{
PointTo*AxisLen, axesRadius*3, PointTo*AxisLen*1.075, 0
texture{Dark_Texture}
}
}
#end // of macro Axis_()
#macro AxisXYZ( AxisLenX, AxisLenY, AxisLenZ, axesRadius, Tex_Dark, Tex_Light)
union{
#if (AxisLenX != 0)
object { Axis_(x, AxisLenX, axesRadius, Tex_Dark, Tex_Light) }// x-Axis
text { ttf "arial.ttf", "x", 0.15, 0 texture{Tex_Dark}
scale 0.5 translate <AxisLenX+0.05,0.4,-0.10>}
#end
#if (AxisLenY != 0)
object { Axis_(y, AxisLenY, axesRadius, Tex_Dark, Tex_Light) }// y-Axis
text { ttf "arial.ttf", "y", 0.15, 0 texture{Tex_Dark}
scale 0.5 translate <-0.75,AxisLenY+0.50,-0.10>}
#end
#if (AxisLenZ != 0)
object { Axis_(z, AxisLenZ, axesRadius, Tex_Dark, Tex_Light) }// z-Axis
text { ttf "arial.ttf", "z", 0.15, 0 texture{Tex_Dark}
scale 0.5 translate <-0.75,0.2,AxisLenZ+0.10>}
#end
} // end of union
#end// of macro "AxisXYZ( ... )"
#declare txtrAxisLite = texture { pigment{ color rgb<1,1,1>*.3} finish { phong 1} }
#declare txtrAxisDark = texture { pigment{ color rgb<1,1,1>*.8} finish { phong 1} }
#macro RenderClockedTorusKnot(p, q, majRad, minRad, plotRadius, PointCount, completion, txtr)
#local LastPos = <0, 0, 0>;
#for (pointNdx, 0, PointCount * completion)
#local Theta = 2 * pi * pointNdx / PointCount;
// Torus knot path calculations
//#local X = (majRad + minRad * cos(q * Theta)) * cos(p * Theta);
//#local Y = (majRad + minRad * cos(q * Theta)) * sin(p * Theta);
//#local Z = minRad * sin(q * Theta);
#local Y = (majRad + minRad * cos(q * Theta)) * cos(p * Theta);
#local X = (majRad + minRad * cos(q * Theta)) * sin(p * Theta);
#local Z = minRad * sin(q * Theta);
#local Pos = <X,Y,Z>;
#if (pointNdx > 0)
union {
cylinder {
LastPos, Pos, plotRadius open
texture {txtr}
}
sphere { LastPos, plotRadius texture {txtr} }
} // end union
#end
#local LastPos = Pos;
#end
#end
#macro renderClockedUnitQ(p, q, majRad, minRad, plotRadius, PointCount, txtr)
#local LastPos = <0, 0, 0>;
#for (pointNdx, 0, (PointCount) * clock/q )
#local Theta = 2 * pi * pointNdx / PointCount;
// Torus knot path calculations
//#local X = (majRad + minRad * cos(q * Theta)) * cos(p * Theta);
//#local Y = (majRad + minRad * cos(q * Theta)) * sin(p * Theta);
//#local Z = minRad * sin(q * Theta);
#local Y = (majRad + minRad * cos(q * Theta)) * cos(p * Theta);
#local X = (majRad + minRad * cos(q * Theta)) * sin(p * Theta);
#local Z = minRad * sin(q * Theta);
#local Pos = <X, Y, Z>;
#if (pointNdx > 0)
union {
cylinder {
LastPos, Pos, plotRadius open
texture {txtr}
}
sphere { LastPos, plotRadius texture {txtr} }
} // end union
#end
#local LastPos = Pos;
#end
#end
// Scene //
light_source{<15,25,25>*100 color White shadowless}
sky_sphere{ pigment{ gradient <01,0,0>
color_map{ [0 color rgb<0.24,0.34,0.56>*1.2]
[0.5 color rgb<0.24,0.34,0.56>*0.4]
[0.5 color rgb<0.24,0.34,0.56>*0.4]
[1.0 color rgb<0.24,0.34,0.56>*1.2]
}
rotate< 0,0, 0>
scale 2 }
}
camera {
orthographic
angle 40
location <1,1,.75>*8
location x*14
look_at y*0
up z
right x*image_width/image_height
}
// poloid:toroid = p:q knot ratio
#declare poloid = 13;
#declare toroid = 8;
#declare phaseCount = 1;
// Torus profile (golden torus)
#declare majRad = pow(sqrt(5)*0.5+0.5,4);
#declare minRad = majRad - 1;
#declare plotRad = 1/16;
#declare knotScale = .4;
#declare segmentCount = 800;
#declare txtrCu = texture{pigment{Brown}};
#declare txtrA = texture{pigment{Red }};
#declare txtrB = texture{pigment{Green}};
#declare txtrC = texture{pigment{Blue }};
union{
// Render a copper knot of 8 unitQ helicals //
#for (k,0, toroid-1)
#for (j,1,phaseCount)
union{
renderClockedUnitQ( poloid, toroid, majRad, minRad, plotRad, segmentCount, texture{txtrCu} )
rotate z*(k*360/toroid)
rotate z*(j*360/phaseCount)
scale knotScale
}
#end
/*
union{
renderClockedUnitQ( poloid, toroid, majRad, minRad, plotRad, segmentCount, 1/2, texture{txtrCu} )
rotate z*(j*360/phaseCount)
rotate x*0
rotate z*180
scale knotScale
}
*/
AxisXYZ( 8.5, 8.5, 0, .03, txtrAxisLite, txtrAxisDark)
#end
rotate -x*90 // Rotate the torus axis with the Z axis, rendered as vertical axis.
// rotate z*360/24*clock
}
The AI and I Dialogs
Ode to Future AIs <> Unified Quantum Consciousness <> Alien Consciousness <> Visage of a Dimple in Time <> Something Alien <> Data Examples <> Comp sci <> Scatter-Gather <> Redundant simplicity <> Talk:Spin WaveArray <> The Plow Share <> Quantum joke <> Ancient Vedas <> Orb Whispers <> Time technology with rotating magnetic fields <> AI Art <> Radii walk in a bar <> Light's Flow through Time <> Three Buddhas <> The Epic Chronosymphonogram <> Temporal Collision Chronicles —Beings of Earth