Logo by Pauldelbrot - 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: Check out the originating "3d Mandelbulb" thread here
 
*
Welcome, Guest. Please login or register. April 19, 2024, 06:30:20 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]   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: Escape Time version of the Tetrahedral Apollonian Gasket  (Read 9120 times)
0 Members and 1 Guest are viewing this topic.
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« on: April 09, 2011, 05:45:39 PM »

Hello,

This is my first topic post, so excuse me if I make something wrong..  embarrass

Recently DarkBean asked me about the escapetime version of the Tetrahedral Apollonian Gasket (its on my da gallery), and after sometime searching on my old files, I have found it, so here is the code:

First, variable initializations:
Code:
float Tetrahedron[]={
0.000,  0.000,  1.000,
0.943,  0.000, -0.333,
-0.471,  0.816, -0.333,
-0.471, -0.816, -0.333
};

float Ta[5],Tb[5],Tc[5],Td[5];

for (int tr=0; tr<5;tr++){
if (tr<4){
Ta[tr]=Tetrahedron[tr*3];
Tb[tr]=Tetrahedron[tr*3+1];
Tc[tr]=Tetrahedron[tr*3+2];
Td[tr]=(0.81649658573140704000)*1.1;//this parameter is for distorting the size of the inversion..
} else {
Ta[tr]=0;
Tb[tr]=0;
Tc[tr]=0;
Td[tr]=(0.18350338935852051000)*1.1;//this parameter is for distorting the size of the inversion..
}
Td[tr]=Td[tr]*Td[tr];
}



And the function. it returns true if its solid, false if its just empty space (its crude and unnoptimized!..)
Scan the area around the unit sphere..
Code:

bool TGasket(float x, float y, float z)
{
if(sqrt(x*x+y*y+z*z)>0.75)return false; //filter unnecessary areas, must be removed for other sets
bool escape;//if the orbit escapes, it returns false, else it return true..
int ic;
float X1[5],Y1[5],Z1[5],DST[5];//temporal storage of the iteration values and distances
for (ic=0;ic<12;ic++){
for (int tr=0;tr<5;tr++){
const float ax=x - Ta[tr];
const float ay=y - Tb[tr];
const float az=z - Tc[tr];
const float radius=Td[tr]/(ax*ax+ay*ay+az*az);
X1[tr] = Ta[tr] + (x - Ta[tr])*radius;
Y1[tr] = Tb[tr] + (y - Tb[tr])*radius;
Z1[tr]=  Tc[tr] + (z - Tc[tr])*radius;

//Method 1 Centered at Origin only valid for hedra like fractals
DST[tr]=X1[tr]*X1[tr]+Y1[tr]*Y1[tr]+Z1[tr]*Z1[tr];

//Method 2 General, using transformation centers. valid for all sets
//DST[tr]=(Ta[tr]-X1[tr])*(Ta[tr]-X1[tr])+(Tb[tr]-Y1[tr])*(Tb[tr]-Y1[tr])+(Tc[tr]-Z1[tr])*(Tc[tr]-Z1[tr]);

}

int tr1=0;
float rdst=0;
//select the transformation..the most distant one wins
for (int tr=0;tr<5;tr++){
if (rdst<DST[tr]){
rdst=DST[tr];
tr1=tr;
}
}
x=X1[tr1];
y=Y1[tr1];
z=Z1[tr1];
if(2.5<DST[tr1])break;
}
if(ic<11 && ic>1)escape=true;else escape=false;//filter the first iteration, the set lies in the center of a coconut like sphere
return escape;
}


This solution may work for every circle inversion based fractal. I have tested it on the Icosahedral and the Dodecahedral gaskets and it produce very interesting results.

If anyone is interested on this, I can post other variations..

Thanks

Aexion



 


* Tetrahedral1.jpg (58.8 KB, 512x512 - viewed 642 times.)

* Tetrahedral2.jpg (53.76 KB, 512x512 - viewed 734 times.)

* Tetrahedral3.jpg (53.45 KB, 512x512 - viewed 668 times.)

* Tetrahedral4.jpg (53.42 KB, 512x512 - viewed 735 times.)
Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
fractalrebel
Fractal Lover
**
Posts: 211



WWW
« Reply #1 on: April 10, 2011, 02:53:52 AM »

Hi Aexion,

I am not sure this is quite right. The standard Appllonian Gasket is created from circle inversions. The Gasket for the Platonic Solids cases should be from Sphere inversions. Here is my Tetrahedral Appollonian Gasket. The coloring is chosen so that each sphere is colored according to its generator. There are four generators so there are four colors. If you look closely, no to spheres that are the same color should touch.


* tetrahedron2.jpg (145.3 KB, 640x640 - viewed 769 times.)
Logged

fractalrebel
Fractal Lover
**
Posts: 211



WWW
« Reply #2 on: April 10, 2011, 03:00:00 AM »

The previous example had 100 iterations. This example has only 5 and the spheres are set to show partial transparency so that you can readily see the internal structure.


* tetrahedron2_trans.jpg (43.29 KB, 640x640 - viewed 805 times.)
Logged

fractalrebel
Fractal Lover
**
Posts: 211



WWW
« Reply #3 on: April 10, 2011, 03:17:32 AM »

Here is a Tetrahedral Gasket that has been "sliced", which is another way to see some of the internal structure. Some texture has also been added to the spheres.


* PuzzleInBlue.jpg (117.58 KB, 640x640 - viewed 658 times.)
Logged

fractalrebel
Fractal Lover
**
Posts: 211



WWW
« Reply #4 on: April 10, 2011, 03:26:39 AM »

One last image. This one is a Dodecahedral Gasket with coloring based upon the sphere radius. Small spheres are colored gold and the larger ones blue.


* dodecahedron2.jpg (164.9 KB, 640x640 - viewed 786 times.)
Logged

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


Fragments of the fractal -like the tip of it


« Reply #5 on: April 10, 2011, 10:58:30 AM »

@Aexion
This formula looks very good to me cheesy - except for the fact that spheres seems to have a wrong radius settings (they should touch in a single point wink )

The only problem is that uses lists, and it's quite not easy to translate in assembly. I bet that I must use those complicated instructions like fld qword ptr ds:[EBP+EAX] shocked ... huh?

But I will try Azn
« Last Edit: April 10, 2011, 11:03:27 AM 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 #6 on: April 10, 2011, 11:18:05 AM »

Hi Aexion,

I am not sure this is quite right. The standard Appllonian Gasket is created from circle inversions. The Gasket for the Platonic Solids cases should be from Sphere inversions. Here is my Tetrahedral Appollonian Gasket. The coloring is chosen so that each sphere is colored according to its generator. There are four generators so there are four colors. If you look closely, no to spheres that are the same color should touch.

Are you sure you have readed carefully the formula? wink

Quote
const float radius=Td{ tr }/(ax*ax+ay*ay+az*az);
   
« Last Edit: April 10, 2011, 11:20:12 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #7 on: April 10, 2011, 01:44:52 PM »

@Aexion
This formula looks very good to me cheesy - except for the fact that spheres seems to have a wrong radius settings (they should touch in a single point wink )

The only problem is that uses lists, and it's quite not easy to translate in assembly. I bet that I must use those complicated instructions like fld qword ptr ds:[EBP+EAX] shocked ... huh?

But I will try Azn

Oh,I forgot to mention that.. look at the code initialization, you will see this line:
Code:
Td[tr]=(0.81649658573140704000)*1.1;//this parameter is for distorting the size of the inversion..

and:

Code:
Td[tr]=(0.18350338935852051000)*1.1;//this parameter is for distorting the size of the inversion..

By changing the 1.1 by 1.0, you will get the real solution, but its boring, very boring.. hence why I have increased the size of the inversion..

I forgot that you cannot use arrays, let me try to unwind the loops, but the formula will be larger..

Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #8 on: April 10, 2011, 03:46:22 PM »

Yeah I can try to use arrays but it's hard to do, I am not as expert by Jesse embarrass

Anyway I will not transpose this formula tomorrow, so let me take my time. If you want to add something you are welcome!

For example, I need to know exactly what parameters should be user defined before beginning cheesy
Logged

No sweat, guardian of wisdom!
Aexion
Conqueror
*******
Posts: 116


The Fractal Hermit


WWW
« Reply #9 on: April 10, 2011, 04:26:30 PM »

Yeah I can try to use arrays but it's hard to do, I am not as expert by Jesse embarrass

Anyway I will not transpose this formula tomorrow, so let me take my time. If you want to add something you are welcome!

For example, I need to know exactly what parameters should be user defined before beginning cheesy

Ok..
The formula has very few params, so later I will unwind the loops and rewrite it in a more clearly way..

Here is also another formula..this uses the vertices of a Icosahedron, but I think that you can hardly use it, since it uses 13 transformations and it requires a double  type  (if you use floats, some strange box shapes appers).. anyways, here is it:

Initializations:
Code:
const float Icosahedron[]={
   0.000f,  0.000f,  1.000f,
  0.894f,  0.000f,  0.447f,
  0.276f,  0.851f,  0.447f,
 -0.724f,  0.526f,  0.447f,
 -0.724f, -0.526f,  0.447f,
   0.276f, -0.851f,  0.447f,
   0.724f,  0.526f, -0.447f,
  -0.276f,  0.851f, -0.447f,
 -0.894f,  0.000f, -0.447f,
  -0.276f, -0.851f, -0.447f,
   0.724f, -0.526f, -0.447f,
  0.000f,  0.000f, -1.000
};

float Ta[15],Tb[15],Tc[15],Td[15];



const float disx=Icosahedron[0]-Icosahedron[3];
const float disy=Icosahedron[1]-Icosahedron[4];
const float disz=Icosahedron[2]-Icosahedron[5];
const float tdistance=sqrt(disx*disx+disy*disy+disz*disz)/2;//calc the size of the transformation
const float variation=1.05;//make the transformation a little bigger, so they intersect.

for (int tr=0; tr<13;tr++){
if (tr<12){
//Icosahedron corners
Ta[tr]=Icosahedron[tr*3];
Tb[tr]=Icosahedron[tr*3+1];
Tc[tr]=Icosahedron[tr*3+2];
Td[tr]=tdistance*variation;
} else {
//central transformation
Ta[tr]=0;
Tb[tr]=0;
Tc[tr]=0;
Td[tr]=(1-tdistance)*variation;
}
Td[tr]=Td[tr]*Td[tr];
}



And the formula:
Code:
bool Icosa(double x, double y, double z, int iter)
{
if(sqrt(x*x+y*y+z*z)>1.1)return false; //filter unneresary areas, must be removed for other sets
bool escape;//if the orbit escapes, it returns false, else it return true..
int ic;
double X1[13],Y1[13],Z1[13],DST[13];//temporal storage of the iteration values and distances
for (ic=0;ic<iter;ic++){
for (int tr=0;tr<13;tr++){
const double ax=x - Ta[tr];
const double ay=y - Tb[tr];
const double az=z - Tc[tr];
const double radius=Td[tr]/(ax*ax+ay*ay+az*az);
X1[tr] = Ta[tr] + (x - Ta[tr])*radius;
Y1[tr] = Tb[tr] + (y - Tb[tr])*radius;
Z1[tr]=  Tc[tr] + (z - Tc[tr])*radius;

//Method 1 Centered at Origin
//DST[tr]=X1[tr]*X1[tr]+Y1[tr]*Y1[tr]+Z1[tr]*Z1[tr];

//Method 2 General, using transformation centers
DST[tr]=(Ta[tr]-X1[tr])*(Ta[tr]-X1[tr])+(Tb[tr]-Y1[tr])*(Tb[tr]-Y1[tr])+(Tc[tr]-Z1[tr])*(Tc[tr]-Z1[tr]);

}

int tr1=0;
double rdst=0;
//select the transformation..the most distant one wins
for (int tr=0;tr<13;tr++){
if (rdst<DST[tr]){
rdst=DST[tr];
tr1=tr;
}
}
x=X1[tr1];
y=Y1[tr1];
z=Z1[tr1];
if(1.5<DST[tr1])break;
}
if(ic<iter && ic>1)escape=true;else escape=false;
return escape;
}


call it by:
bool Icosa(x, y,z, 16);  //16 iterations

This formula is very interesting and beautiful, saddly my renders are not very good, but the internal structure is very fine..

I have included the renders of the two methods.



* Icosa.jpg (186.96 KB, 640x640 - viewed 661 times.)

* Icosa1.jpg (205.68 KB, 640x640 - viewed 765 times.)
Logged

Fractals all the way..
Incendia for 3D Fractals
Aural for Musical Fractals
DarkBeam
Global Moderator
Fractal Senior
******
Posts: 2512


Fragments of the fractal -like the tip of it


« Reply #10 on: April 10, 2011, 04:58:18 PM »

The problem is not in the var type; I use QWORD pointers so they are natively double precision, but the more the code is long the more it takes to translate. smiley

Anyway really thanks for the effort! smiley It's not said that I will not be able to do the translation Azn
Logged

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

Related Topics
Subject Started by Replies Views Last post
Apollonian gasket in Black Rock Desert in Nevada Fractals Applied or in Nature quaternion 0 4900 Last post December 21, 2009, 02:25:01 PM
by quaternion
apollonian gasket FractalForums.com Banner Logos jimdenevan 1 3428 Last post January 05, 2010, 11:35:46 AM
by Nahee_Enterprises
Escape-time LRIFS Programming David Makin 11 9037 Last post March 22, 2010, 04:05:57 PM
by kram1032
drawing Apollonian Gasket - newton method fractals Help & Support amirkhabbaz 4 2462 Last post December 23, 2010, 09:08:07 PM
by amirkhabbaz
Apollonian Gasket 3d Mandelbulb3D Gallery « 1 2 ... 13 14 » jotero 206 64502 Last post March 22, 2017, 09:56:06 PM
by jotero

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.15 seconds with 24 queries. (Pretty URLs adds 0.014s, 2q)