DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« on: January 25, 2012, 07:12:06 PM » |
|
I am very lame, was thinking about making a Klein Bottle using four half-toruses. The problem is that one of them should have a variable radius, that closes the bottle in itself smoothly, and I am not able to do this Was thinkin about a function of atan(y,x) to do this; #info DarkBeam's Klein Bottle #include "DE-Raytracer.frag" #group KBottle
#define PI 3.14159
//Radius of the tubes uniform float tubeRadius; slider[0,0.3614,100.]
//Radius of the goup of tubes uniform float groupRadius; slider[0,0.85,5.]
//Radius of the whole object (because it looks like a torus (-:) uniform float objectRadius; slider[0,.7,1.7]
uniform float ggg; slider[0,.7,1.7] uniform float hhh; slider[0,3.,12.] float Tor(vec3 p, float R, float tR, float Tube){ float j; float a = p.x,b = p.y,c = p.z; j =sqrt(a*a+b*b)-R ; j =sqrt(j*j+c*c); return abs(j-tR)-Tube; }
float ETor(vec3 p, float R, float tR, float Tube, float el ){ // THIS IS WRONG float j; float a = p.x,b = p.y,c = p.z; j =sqrt(a*a+b*b); a = (atan(b,a))/hhh; j = j*(ggg-tubeRadius*a*a*a)-R; j =sqrt(j*j+c*c); return abs(j-tR)-Tube; }
float YinYang(vec3 p, float R, float tR, float Tube){ float j; float a = p.x,b = p.y,c = p.z; if (a>0) {b+=R;} else {b-=R;} j =sqrt(a*a+b*b)-R ; j =sqrt(j*j+c*c); return abs(j-tR)-Tube; }
float DE(vec3 p) { float d1,d2,d3; d1=1000;//Tor(p,1.,.3,.1); if (p.z<0.0 &&1) { return .1-p.z; } if (p.x>0) { p.y +=objectRadius; d1=ETor(p/groupRadius,2.*1.,.2,.02,-tubeRadius); p.y -=objectRadius; } else { p.y +=2.; d1=Tor(p.yzx,.2,.1,.02); p.y -= 2.; } d3=YinYang(p,1.,.3,.02); d1=min(d1,d3); return d1; } #preset default FOV = 0.62536 Eye = -0.684574,2.97917,-0.56351 Target = 1.28819,-5.52322,0.968231 Up = -0.474302,-0.261493,-0.84063 AntiAlias = 1 Detail = -3 DetailAO = -1.57143 FudgeFactor = 0.66265 MaxRaySteps = 64 BoundingSphere = 4 Locked Dither = 0 Locked NormalBackStep = 1 AO = 0,0,0,0.90123 Specular = 4.4304 SpecularExp = 16 SpotLight = 0.435294,0.737255,1,0.5 SpotLightDir = 0.65626,0.5 CamLight = 1,0.941176,0.898039,1.0566 CamLightMin = 0 Glow = 1,1,1,0 GlowMax = 20 Fog = 0 HardShadow = 0 ShadowSoft = 12.9032 Reflection = 0 BaseColor = 0.701961,0.701961,0.701961 OrbitStrength = 0 X = 0.411765,0.6,0.560784,0.41748 Y = 0.666667,0.666667,0.498039,-0.16504 Z = 1,0.258824,0.207843,1 R = 0.0823529,0.278431,1,0.82352 BackgroundColor = 0.607843,0.866667,0.560784 GradientBackground = 0.3261 CycleColors = true Cycles = 4.04901 EnableFloor = false FloorNormal = 0,0,0 FloorHeight = 0 FloorColor = 1,1,1 tubeRadius = 0.07534 groupRadius = 0.29851 objectRadius = 0.43077 Rotations = 3 RotDenominator = 3 RotNumeratorX = -2 RotNumeratorY = -4 #endpreset The problem is that the cut plane does not work well and I did not found a good mangling for that atan() Thanks for your endless patience
|
|
« Last Edit: January 25, 2012, 07:14:12 PM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #1 on: January 25, 2012, 08:14:27 PM » |
|
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
blob
Strange Attractor
Posts: 272
|
|
« Reply #2 on: January 25, 2012, 08:22:07 PM » |
|
Completely off-topic but I was wondering if an hyperbolic tesselation transform for dIFS was in the realm of the possible?
|
|
|
Logged
|
|
|
|
hobold
Fractal Bachius
Posts: 573
|
|
« Reply #3 on: January 25, 2012, 11:00:28 PM » |
|
|
|
|
Logged
|
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #5 on: January 26, 2012, 10:28:13 AM » |
|
Thanks but I found a workaround for my function - here it is. For some values it goes wrong but hey it's normal #info DarkBeam's Klein Bottle #include "DE-Raytracer.frag" #group KBottle
#define PI 3.14159
//Radius of the tubes uniform float tubeRadius; slider[0,0.7,3.]
//Radius of the goup of tubes uniform float groupRadius; slider[0,0.13,0.4]
//Radius of the whole object (because it looks like a torus (-:) uniform float objectRadius; slider[0,.7,1.7]
uniform float ggg; slider[0.,1.6,4.] //uniform float hhh; slider[0.,3.,12.] float Tor(vec3 p, float R, float tR, float Tube){ float j; float a = p.x,b = p.y,c = p.z; j =sqrt(a*a+b*b)-R ; j =sqrt(j*j+c*c); return abs(j-tR)-Tube; }
float ETor(vec3 p, float R, float tRmin, float tRmax, float Tube ){ float j; float a = p.x,b = p.y,c = p.z; j =sqrt(a*a+b*b); a = (atan(b,a)/PI-ggg+2); a = clamp(a,tRmin,tRmax); j = j-R; j =sqrt(j*j+c*c); return abs(j-a)-Tube; }
float YinYang(vec3 p, float R, float tR, float Tube){ float j; float a = p.x,b = p.y,c = p.z; if (a>0) {b+=R;} else {b-=R;} j =sqrt(a*a+b*b)-R ; j =sqrt(j*j+c*c); return abs(j-tR)-Tube; }
float DE(vec3 p) { float d1,d2,d3; d1=1000;//Tor(p,1.,.3,.1); if (p.z<0.0 &&0) { return .1-p.z; } if (p.x>0) { d1=ETor(p,2.*1.,tubeRadius-2*groupRadius,tubeRadius,.02); } else { p.y +=2.; d1=Tor(p.yzx,tubeRadius-groupRadius,groupRadius,.02); p.y -= 2.; } d3=YinYang(p,1.,tubeRadius,.02); d1=min(d1,d3); return d1; } #preset default FOV = 0.62536 Eye = -0.684574,2.97917,-0.56351 Target = 1.28819,-5.52322,0.968231 Up = -0.474302,-0.261493,-0.84063 AntiAlias = 1 Detail = -3 DetailAO = -1.57143 FudgeFactor = 0.66265 MaxRaySteps = 64 BoundingSphere = 4 Locked Dither = 0 Locked NormalBackStep = 1 AO = 0,0,0,0.90123 Specular = 4.4304 SpecularExp = 16 SpotLight = 0.435294,0.737255,1,0.5 SpotLightDir = 0.65626,0.5 CamLight = 1,0.941176,0.898039,1.0566 CamLightMin = 0 Glow = 1,1,1,0 GlowMax = 20 Fog = 0 HardShadow = 0 ShadowSoft = 12.9032 Reflection = 0 BaseColor = 0.701961,0.701961,0.701961 OrbitStrength = 0 X = 0.411765,0.6,0.560784,0.41748 Y = 0.666667,0.666667,0.498039,-0.16504 Z = 1,0.258824,0.207843,1 R = 0.0823529,0.278431,1,0.82352 BackgroundColor = 0.607843,0.866667,0.560784 GradientBackground = 0.3261 CycleColors = true Cycles = 4.04901 EnableFloor = false FloorNormal = 0,0,0 FloorHeight = 0 FloorColor = 1,1,1 tubeRadius = 0.07534 groupRadius = 0.29851 objectRadius = 0.43077 Rotations = 3 RotDenominator = 3 RotNumeratorX = -2 RotNumeratorY = -4 #endpreset
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
fractower
Iterator
Posts: 173
|
|
« Reply #6 on: January 26, 2012, 05:32:40 PM » |
|
It seems that everyone with a Shapeways account has done a Klein bottle. This is my attempt http://www.shapeways.com/model/242965/The surface is is made from a 3d spirograph texture.
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #7 on: January 26, 2012, 06:07:32 PM » |
|
The problem is that you can't (easily) extract a DE from a parametric equation. If that was possible easily I certainly had no need to ask
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
kram1032
|
|
« Reply #8 on: January 26, 2012, 10:44:35 PM » |
|
Well, here you have an implicit formulation of the symmetric projection of the Klein bottle http://www.wolframalpha.com/input/?i=klein+bottleIf you explicitly want the bottle-like one, I'm pretty sure, that requires yet another Polynomial of degree 12. Most likely one that, due to lack of symmetry, is even more complicated than the one given there...
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #9 on: January 26, 2012, 11:26:18 PM » |
|
I have further improved my routine removing the "intersected" zone, so now I have a "real" bottle that I can explore going inside it. Sorry, a Klein bottle has no inside Kram; I tried all parametrizations but none looked as pleasing as this; the symm one is like a "fat" bottle, very easy to implement as it is a single expression but a lot less elegant to my eye
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
kram1032
|
|
« Reply #10 on: January 27, 2012, 11:30:26 AM » |
|
Well, I guess that's a pure opinion thing, but I personally am a sucker for symmetry (any kind of, also fractal symmetry, obviously), so the symmetric version of the Klein bottle seems nicer to me. The "bottle" one seems very much like giving it a real life meaning which it really hasn't.
The symmetry also helps to understand the shape better without your mind constantly interfering associations...
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #11 on: January 27, 2012, 12:49:27 PM » |
|
Images
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
cKleinhuis
|
|
« Reply #12 on: January 27, 2012, 02:56:05 PM » |
|
ok, can we create drinking glasses from it and sell it as ff merchandise ?! or is it open at the other end
|
|
|
Logged
|
---
divide and conquer - iterate and rule - chaos is No random!
|
|
|
DarkBeam
Global Moderator
Fractal Senior
Posts: 2512
Fragments of the fractal -like the tip of it
|
|
« Reply #13 on: January 27, 2012, 04:30:14 PM » |
|
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
kram1032
|
|
« Reply #14 on: January 27, 2012, 06:10:34 PM » |
|
Lawl... Well, since the 3D projection of such a Klein Bottle will always intersect with itself, you have a part where liquid can be kept in... However, that part will not allow the liquid to get out again, so it's kinda pointless... In an unprojected, "flat" version (by means of curvature and other things, the Klein Bottle actually behaves like the euclidean plane despite being limited in surface), you obviously couldn't keep any liquid. Especially once you start arguing what side is inside and after going in a circle once you suddenly realize, EVERY side is inside. Or outside for that matter.
|
|
|
Logged
|
|
|
|
|