Logo by AGUS - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Visit the official fractalforums.com Youtube Channel
 
*
Welcome, Guest. Please login or register. January 16, 2026, 04:50:51 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1] 2   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Lame Klein bottle  (Read 1221 times)
0 Members and 1 Guest are viewing this topic.
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« on: January 25, 2012, 07:12:06 PM »

 embarrass 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 undecided

Was thinkin about a function of atan(y,x) to do this;

Code:
#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() undecided

Thanks for your endless patience kiss


* gedatou.jpg (41.15 KB, 890x641 - viewed 43 times.)
« 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 »

If somebody finds the answer I will donate the Figure-8 immersion formula, that looks so cool grin grin grin

Yes it's still a Klein Bottle but does not look like huh?


* kleinkl.jpg (31.51 KB, 615x503 - viewed 41 times.)
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?huh?
Logged
hobold
Fractal Bachius
*
Posts: 573


« Reply #3 on: January 25, 2012, 11:00:28 PM »

A torus with a varying radius? Here: http://en.wikipedia.org/wiki/Dupin_cyclide
Logged
fractower
Iterator
*
Posts: 173


« Reply #4 on: January 25, 2012, 11:29:56 PM »


From my second favorite math related sight http://paulbourke.net/geometry/klein/

Paul rules!!
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 A Beer Cup

Code:
#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


* gedatou.jpg (44.69 KB, 1006x547 - viewed 40 times.)
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 »

Quote from: fractower
From my second favorite math related sight http://paulbourke.net/geometry/klein/

Paul rules!!

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 wink
Logged

No sweat, guardian of wisdom!
kram1032
Fractal Senior
******
Posts: 1863


« 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+bottle

If 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 wink
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 smiley
Logged

No sweat, guardian of wisdom!
kram1032
Fractal Senior
******
Posts: 1863


« 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 shocked


* kbottle.jpg (173.33 KB, 1193x854 - viewed 45 times.)
Logged

No sweat, guardian of wisdom!
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« 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 huh? cheesy
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 »

ok, can we create drinking glasses from it and sell it as ff merchandise ?!
or is it open at the other end huh? cheesy


Oh yeah, why don't you affiliate with those guys! http://www.kleinbottle.com/ A Beer Cup A Beer Cup A Beer Cup

 grin the wave
Logged

No sweat, guardian of wisdom!
kram1032
Fractal Senior
******
Posts: 1863


« 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. cheesy
Or outside for that matter.
Logged
Pages: [1] 2   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
thomz idea of a klein bottle Images Showcase (Rate My Fractal) thom 0 1238 Last post March 28, 2012, 03:59:54 AM
by thom
Cubic Woods - the Fractal Bottle Opener Mandelbulb3D Gallery KRAFTWERK 2 1194 Last post September 17, 2014, 04:15:21 PM
by KRAFTWERK
NOT a Klein bottle... Images Showcase (Rate My Fractal) thom 0 1287 Last post December 11, 2015, 01:03:28 AM
by thom
The Klein Bottle in your eyes General Discussion kram1032 0 1045 Last post August 30, 2016, 01:44:49 AM
by kram1032
Savage Gardens of Klein-- Altar of Fire and Ice 8K Mandelbulber Gallery paigan0 2 1243 Last post May 02, 2017, 03:44:41 AM
by paigan0

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.298 seconds with 24 queries. (Pretty URLs adds 0.012s, 2q)