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 us on facebook
 
*
Welcome, Guest. Please login or register. April 16, 2024, 09:12:44 AM


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 [3] 4   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: Not fractal but funny; general torus knots DE routine  (Read 7631 times)
0 Members and 1 Guest are viewing this topic.
hobold
Fractal Bachius
*
Posts: 573


« Reply #30 on: January 19, 2012, 06:13:39 PM »

very weird things happen, (because DE is supposed to be positive outside the knot) and in section the torus does not show plain circles anymore. Ideas?
The cross section appears to be a hyperbola. Just like the circle you expected (i.e. a specific ellipse), both these curves belong to the family of quadrics (also known as conic sections). Quadrics are polynomials of total degree 2. Planar quadrics have the general formula

q(x,y) = a*x^2 + b*y^2 + c*x*y + d*x + e*y + f

and any specific quadric curve is the zero set of a specific quadric, i.e. q(x,y) = 0

For an ellipse (and specifically a circle), both quadratic coefficients a and b have the same sign. For a hyperbola, they have different signs. (More special cases exist, but maybe the above information is helpful in understanding what happens with the knots.)
Logged
Syntopia
Fractal Molossus
**
Posts: 681



syntopiadk
WWW
« Reply #31 on: January 19, 2012, 06:44:36 PM »

syntopia you are kidding right? grin
Those polytopes look damnedly complicated to me.

Yes, just kidding :-)
But, if you need a challenge...

Btw, you ask if your fake and real knots are equivalent - they are not.
You can do a tricoloring of the first, but not of the real one: http://en.wikipedia.org/wiki/Tricolorability
(Try it - it is a bit like sudoku)

who was asking the place is dying somehow ?!?!?!? !

Not dying - people are just moving on into knot theory :-)
Logged
Jesse
Download Section
Fractal Schemer
*
Posts: 1013


« Reply #32 on: January 19, 2012, 07:25:37 PM »

Using Syntopia's GLSL snippet in Knighty's Pseudo Kleinian example smiley

Wow, how do you put both formulas together?

I did only some odd testings, but i guess you need a type of analytical formula with scaling to adjust the DE you received from the knots formula?  Assuming you iterated first with the Pseudo Kleinian and did the knots after that.


so, those de function cant be used to be incorporated in the fractals ?
they just can be used in a layered manner ?!


See what Subblue says, i think it is possible somehow, but the way m3d is using both types of formulas is really very different, and a combination is limited for some reasons.  Not to say that the common formulas are also of different kinds, but are all escape time formulas.
The dIFS thing is a direct DE formula without "bailouting", only n iterations minimum DE combinated.

Quote

.... btw. what a about a layering .... *duck away....*

Yep, run bastard, run  wink

Beside of 18 bytes per pixel for a common rendering (considered to be one layer), just stick as many of images together in a lame image manipulating proggy of your choice  bubble gum
 A Beer Cup
Logged
subblue
Conqueror
*******
Posts: 116



WWW
« Reply #33 on: January 19, 2012, 09:10:44 PM »

Wow, how do you put both formulas together?

I did only some odd testings, but i guess you need a type of analytical formula with scaling to adjust the DE you received from the knots formula?  Assuming you iterated first with the Pseudo Kleinian and did the knots after that.

Yes, at the end of the main DE routine I'm just calling the Trefoil method with the final position as the input. It takes a bit of tweaking to get things lining up and it works best with a low number of iterations in the main DE loop.

Code:
return abs(distMult * Trefoil(p) / DEfactor)
Logged

www.subblue.com - a blog exploring mathematical and generative graphics
knighty
Fractal Iambus
***
Posts: 819


« Reply #34 on: January 19, 2012, 10:08:58 PM »

Yes, Pseudo kleinian is in reality a simplification of Theli-At's MB3D parameters. IIRC the shape of that fractal is mainly due to the iteration of Mbox formula in julia mode (a relatively small number of iterations) then the basic shape is given by the remaining formulas. what I did is replacing that last part of the formula by an approximation. You can see it as an orbit trapping at the last iteration. smiley
In principle and in general it is possible to do orbit trapping at each iteration. If I'm not mistaken that's waht is done in d.IFS sphere and d.IFS cube. The problem is that in general getting a good DE is problematic. Nevertheless, the MBox and KIFS and in general transformations based on planar and spherical foldings and similarities give good DE estimates.

Here is my attempt, while trying to understand DarkBeam's formula. Fragmentarium script  cheesy:
Code:
#info tore-imbeddebal knots by knighty (2012). Based on DarkBeam's idea (http://www.fractalforums.com/new-theories-and-research/not-fractal-but-funny-trefoil-knot-routine/30/)
#include "DE-Raytracer.frag"
#group Tore_knots

#define PI 3.14159

//Radius of the tubes
uniform float tubeRadius; slider[0,0.1,0.5]

//Radius of the goup of tubes
uniform float groupRadius; slider[0,0.4,0.5]

//Radius of the whole object (because it looks like a torus (-:)
uniform float objectRadius; slider[0,1,1]

//number of tubes
uniform int    tubesNumber; slider[1,3,10]

//rotation rate of the tubes
uniform int    tubesRotMulN; slider[-20,3,20]

//rotation
uniform float rotationAngle; slider[0,1,360]

uniform float time;

float Ncylinder(vec2 p, int n){
float a=PI/float(n);
vec2 nor=vec2(sin(a),-cos(a));
for(int i=0;i<n/1;i++){
p.y=abs(p.y);
float t=-2.*dot(nor,p); p+=max(0.,t)*nor;
}
p.x-=groupRadius;
return length(p)-tubeRadius;
}
vec3 twist(vec3 p, float ra){
ra*=p.z;
float ca=cos(ra),sa=sin(ra);
return vec3(p.x*ca+p.y*sa,-p.x*sa+p.y*ca,p.z);
}
vec3 bend2PI(vec3 p){
return vec3(length(p.xz),p.y,atan(p.z,p.x));
}
vec3 rotate(vec3 p){
float ra= rotationAngle*2.*PI/360.;
float ca=cos(ra),sa=sin(ra);
return vec3(p.x*ca+p.y*sa,-p.x*sa+p.y*ca,p.z);
}
float DE(vec3 p) {
p=bend2PI(p);
p.x-=objectRadius;
p=twist(p,float(tubesRotMulN)/float(tubesNumber));//one can compute the fudge factor due to twisting
p=rotate(p);
float d=Ncylinder(p.xy, tubesNumber);
return d;
}
#preset default
FOV = 0.62536
Eye = -0.43734,3.38595,0.179052
Target = 0.681321,-5.38885,-0.350126
Up = 0.913916,0.0926774,0.395181
AntiAlias = 1
Detail = -3
DetailAO = -1.57143
FudgeFactor = 0.80723
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
tubesNumber = 5
tubesRotMulN = 6
rotationAngle = 234.547
groupRadius = 0.25904
objectRadius = 0.74074
tubeRadius = 0.07304
#endpreset
« Last Edit: January 23, 2012, 11:06:09 AM by knighty, Reason: What a shame, I didn\'t know what a trefoil knot is. » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #35 on: January 20, 2012, 10:42:07 AM »


Not dying - people are just moving on into knot theory :-)

waaah, i can not allow this to happen! please combine torus de method with existing fractal de methods ....

smiley

i know it is hard because de values are scalar, and no triplexes sad
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Alef
Fractal Supremo
*****
Posts: 1174



WWW
« Reply #36 on: January 21, 2012, 03:57:48 PM »

Knot theory is even more strange than fractals;) But if they would look like DNA... Pelerman didn't had his billion for something about knots.
Logged

fractal catalisator
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #37 on: January 21, 2012, 04:11:52 PM »

Knot theory is even more strange than fractals;) But if they would look like DNA... Pelerman didn't had his billion for something about knots.

Very true. I am trying to find a routine for figure eight-type knots, the most simple solution should be ... well very complicated, because we need to map the 3D space in unusual ways with twists and links. Figure eight cannot be done with "torus twist" alone, but needs also two smaller half-toruses that connect the ending caps. sad And the caps must be very close, to make the knot look realistic

And the Klein bottle? A minimum of 5 different (empty) solids are needed shocked
Logged

No sweat, guardian of wisdom!
Alef
Fractal Supremo
*****
Posts: 1174



WWW
« Reply #38 on: January 21, 2012, 05:23:12 PM »

Sounds difficult, but maybe something worth to search for instead of 3d mandelbrot. However strange these knots are, they had found use in protein chemistry.
« Last Edit: January 21, 2012, 05:29:57 PM by Asdam » Logged

fractal catalisator
visual.bermarte
Fractal Fertilizer
*****
Posts: 355



« Reply #39 on: January 22, 2012, 01:35:48 AM »



« Last Edit: January 22, 2012, 12:57:22 PM by visual » Logged
knighty
Fractal Iambus
***
Posts: 819


« Reply #40 on: January 22, 2012, 08:52:36 PM »

nice renderings visual. A video is very welcome! angel

I am trying to find a routine for figure eight-type knots, the most simple solution should be ... well very complicated, because we need to map the 3D space in unusual ways with twists and links. Figure eight cannot be done with "torus twist" alone, but needs also two smaller half-toruses that connect the ending caps. sad And the caps must be very close, to make the knot look realistic
it seems I've found a simple solution  alien :
Code:
#info knot thingy by knighty (2012). Based on an idea by DarkBeam from fractalforums (http://www.fractalforums.com/new-theories-and-research/not-fractal-but-funny-trefoil-knot-routine/30/)
#include "DE-Raytracer.frag"
#group Trefoil

#define PI 3.14159

//Radius of the tubes
uniform float tubeRadius; slider[0,0.1,0.5]

//Radius of the goup of tubes
uniform float groupRadius; slider[0,0.4,0.5]

//Radius of the whole object (because it looks like a torus (-:)
uniform float objectRadius; slider[0,1,1]

//Rotation Numerator X: actually not a rotation. This is frequency in x direction
uniform int    RotNumeratorX; slider[-10,2,10]

//Rotation Numerator Y: actually not a rotation. This is frequency in y direction. (lissajou figure)
uniform int    RotNumeratorY; slider[-10,4,10]

//Rotation Denominator: this is the rotation "speed" in xz plane
uniform int    RotDenominator; slider[1,3,20]

//Rotations number: how many instances to check. related to the period of the knot. Have to find math formula for that.
uniform int    Rotations; slider[1,1,10]

float Cylinder(vec2 p){
p.x-=groupRadius;
return length(p)-tubeRadius;
}

float twist(vec3 p){//seen from above it is a lissajou fugure
float ra =p.z*float(RotNumeratorX)/float( RotDenominator);
float raz=p.z*float(RotNumeratorY)/float(RotDenominator);
return length(p.xy-vec2(groupRadius*cos(ra)+objectRadius,groupRadius*sin(raz)+objectRadius))-tubeRadius;
}

vec3 bend2PI(vec3 p){
return vec3(length(p.xz),p.y,atan(p.z,p.x));
}

float DE(vec3 p) {
float r=length(p.xz), ang=atan(p.z,p.x),y=p.y;
float d=10000.;
for(int i=0; i<Rotations;i++){
vec3 p=vec3(r,y,ang+2.*PI*float(i));
p.x-=objectRadius;
d=min(d,twist(p));
}
return d;
}
#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


* real-figure-8.JPG (18.66 KB, 407x392 - viewed 392 times.)
Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #41 on: January 23, 2012, 12:38:03 AM »

It looks like an unknotted string to me smiley
If you used my method without a big change you are wrong; fig8 is not torical wink
btw will check again l8...er, cheesy ty and woot visual
Logged

No sweat, guardian of wisdom!
knighty
Fractal Iambus
***
Posts: 819


« Reply #42 on: January 23, 2012, 11:08:05 AM »

Ok! compare: smiley


* compare.JPG (71.92 KB, 855x473 - viewed 58 times.)
Logged
visual.bermarte
Fractal Fertilizer
*****
Posts: 355



« Reply #43 on: January 23, 2012, 12:29:55 PM »

fragmentarium
<a href="http://vimeo.com/moogaloop.swf?clip_id=35496638&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA" target="_blank">http://vimeo.com/moogaloop.swf?clip_id=35496638&amp;server=vimeo.com&amp;fullscreen=1&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=01AAEA</a>
« Last Edit: January 23, 2012, 02:45:34 PM by visual » Logged
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #44 on: January 23, 2012, 12:43:11 PM »

MY GOD wooow, you are a true genius Knighty!!!

I was thinking about doing an iterated minimum of radiuses but I failed as always! Brilliant brilliant! the wave
Logged

No sweat, guardian of wisdom!
Pages: 1 2 [3] 4   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
General introduction to Fractal Geometry General Discussion Jules Ruis 2 4676 Last post November 13, 2006, 05:17:10 PM
by Office_Shredder
3D Fractal Flame Animation - Torus function Best Fractal Animation doncasteel8587 0 5964 Last post November 19, 2006, 05:06:27 PM
by doncasteel8587
Conformally converting a square to a torus requires a fractal structure Fractal News across the World msltoe 0 1743 Last post December 27, 2013, 08:15:29 PM
by msltoe
Knitted Knest of Knighty Knots Mandelbulber Gallery mclarekin 1 940 Last post October 09, 2016, 01:25:23 PM
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.161 seconds with 24 queries. (Pretty URLs adds 0.008s, 2q)