Logo by wmauzey - 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: Did you know ? you can use LaTex inside Postings on fractalforums.com!
 
*
Welcome, Guest. Please login or register. April 26, 2024, 09:26:26 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 [3]   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: Low-hanging dessert: An escape-time donut fractal  (Read 1936 times)
0 Members and 1 Guest are viewing this topic.
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #30 on: January 25, 2016, 07:33:11 AM »

 Thanks msltoe, you sort of put it on a tee for us to swing at. 

<a href="https://www.youtube.com/v/p3F1eyCor-U&rel=1&fs=1&hd=1" target="_blank">https://www.youtube.com/v/p3F1eyCor-U&rel=1&fs=1&hd=1</a>
« Last Edit: January 25, 2016, 08:54:19 AM by M Benesi » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #31 on: January 25, 2016, 08:06:07 AM »

really interesting to watch the evolution of a formula.

@MB if you can find time, can you put together a zip of the frags you would like in the Examples/MBenesi folder for Fragmentarium? I think the collection I have may be out of sync with the stuff you are working with and has mostly beta versions.

btw, nice work guys!  A Beer Cup
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #32 on: January 25, 2016, 08:42:01 AM »

k, tomorrow that will be my project (organize and document frags).  Still have to add stellation/ polygonization/polyhedronization to this one.  Might be neat- or maybe just very nSect by iteration?  <<--- that might work too.  Tomorrow.  

  I didn't get around to the working on the newer computer yet.. because... mmmmhh donut.  

  Ohh, and... I decided to throw a Menger in on some iterations, and.. well, wow.


  And then I thought.. .why not T1 too (just added a T1 to one of those Menger's from above):


  Attached is the latest... It's a feedback version, so you need 3Dickulus's latest version of Fragmentarium if you want to use it, at least until I edit out the feedback part.  Or you do.  cheesy

  It has iterations for rotations, for T1, and for Menger (instead of Donut).  I didn't do Menger on the same iteration as Donuts in this frag.. probably should.  So... yeah.  I'll get on that, unless someone else does.  I'm including the raytracer here, look in the Fragmentarium coloring thread for a couple of links to some textures to use for coloring.


* Donut_with_Menger.frag (17.86 KB - downloaded 31 times.)
* Fast-Raytracer-with-Textures.frag (18.23 KB - downloaded 31 times.)
« Last Edit: January 25, 2016, 08:58:20 AM by M Benesi » Logged

3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #33 on: January 25, 2016, 02:50:42 PM »

 afro take your time man, I hate being interrupted when I'm enjoying a good snack roll eyes
mmmmm... honey glazed!
Thanks for sharing!
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #34 on: January 25, 2016, 06:21:05 PM »

float theta = atan(z.y, z.x)/nSect; ---------------------------atan2?
  In Fragmentarium, atan() = atan2();   //  <-- functuation- it's when programmers end statements in;   
// omg... that's an absolutely horrible pun. 

Quote
                if (theta>-.5) {theta= floor (theta+.5);
                } else { theta= ceil(theta-.5);} -----------------------------------is this if() really giving you the same answer as "round" ?

  floor() gives you the closest integer equal to or less than your input value.  So if you are -.5 and above, if you add in .5, you're doing the same thing as rounding:

floor (1.3 +.5) = round (1.3) = 1   
floor (1.6 +.5) = round (1.6) = 2   // we set the rounding cutoff with .5... can be something else if we want

 once you hit -.5:

floor (-.5 +.5) =  0     !=   round (-.5) = -1

So you switch to the ceiling function (which gives you the nearest integer greater than or equal to your input value) and subtract -.5 instead:

ceil (-1.4 -.5) = ceil (-1.9) = round (-1.4) =  -1
ceil (-2.7 -.5) = ceil (-3.2) = round (-2.7) =  -3

If we added .5 instead of subtracting it:

ceil (-1.4 +.5) = ceil (-.9) =0    !=  round (-1.4) = -1
Logged

Buddhi
Fractal Iambus
***
Posts: 895



WWW
« Reply #35 on: January 25, 2016, 08:13:25 PM »

  Is mistake the word we should be using?  cheesy

  Primary differences?  

1) The torus's smaller radius is used for the radius check
2) if radius check is not passed,  z*=t instead of z/=t (I don't get nice images for z/=t???)
3) different DE (yeah.... that's important!  You get something that resembles Cantor Dust instead of polygonals if you use standard DE)!
4) test1 boolean switch makes it so the SmallerRadius has less of an effect:  (test1 + ~20*SmallerRadius) ~~ (!test1 + SmallerRadius). 

  Use:

1)  start out with smaller radius set to 0
2)  returnMode (should be called DE_Mode) = 2, 3, or 4  to check out the polygonals- you'll get dust if you set smaller radius to 0 for regular DE
3)  Donuts = 4 is a nice one (it does the square shapes)
4)  DonutFactor 1.1~1.3



I started to play with your different DE modes. It's amazing how it works. It looks like shapes are not coming from fractal formula but just from errors of distance estimation.
E.g. I got something like on attached image:

With DE calculation built into formula I can't get more than 4 donuts, too. I also had to change from z/=t to z*=t

So the only way to get different number of donuts (not weird shapes) is to use deltaDE algorithm.

You asked how deltaDE works so here is algorithm (pseudocode is better for explanation):

Code:
vect3 z0 = ResultOfFractalIterations(z)
float r = length(z0)

vect3 z1 = ResultOfFractalIterations(z + vect3(delta, 0,0))
float r1 = length(z1)
float dr1 = fabs(r1 - r) / delta

vect3 z2 = ResultOfFractalIterations(z + vect3(0, delta, 0))
float r2 = length(z2)
float dr2 = fabs(r2 - r) / delta

vect3 z1 = ResultOfFractalIterations(z + vect3(0, 0, delta))
float r3 = length(z3)
float dr3 = fabs(r3 - r) / delta

double dr = sqrt(dr1*dr1 + dr2*dr2 + dr3*dr3)

distance = 0.5 * r / dr  (or distance = 0.5 * r * log(r) / dr for mandelbulbs)

One important remark thing is to calculate z1, z2 and z3 using exactly the same number of iterations as z0
delta must be some very small number. For doubles I use 1e-10. For floats the best is something about 1e-5.

Inside fractal formula we don't need to calculate dr.


* donut1.jpg (216.52 KB, 800x600 - viewed 45 times.)
Logged

M Benesi
Fractal Schemer
****
Posts: 1075



WWW
« Reply #36 on: January 25, 2016, 11:36:40 PM »

Quote
So the only way to get different number of donuts (not weird shapes) is to use deltaDE algorithm.
 What happens when you do DeltaDE combined with the modified DE I introduced?  

Quote
You asked how deltaDE works so here is algorithm (pseudocode is better for explanation):

Code:
vect3 z0 = ResultOfFractalIterations(z)
float r = length(z0)

vect3 z1 = ResultOfFractalIterations(z + vect3(delta, 0,0))
float r1 = length(z1)
float dr1 = fabs(r1 - r) / delta

vect3 z2 = ResultOfFractalIterations(z + vect3(0, delta, 0))
float r2 = length(z2)
float dr2 = fabs(r2 - r) / delta

vect3 z1 = ResultOfFractalIterations(z + vect3(0, 0, delta))
float r3 = length(z3)
float dr3 = fabs(r3 - r) / delta

double dr = sqrt(dr1*dr1 + dr2*dr2 + dr3*dr3)

distance = 0.5 * r / dr  (or distance = 0.5 * r * log(r) / dr for mandelbulbs)

One important remark thing is to calculate z1, z2 and z3 using exactly the same number of iterations as z0
delta must be some very small number. For doubles I use 1e-10. For floats the best is something about 1e-5.

Inside fractal formula we don't need to calculate dr.
 Thanks for the explanation!  That helps a lot.  Quick question:  do you +/- delta, or only add delta?  

  Also, did you ever try skipping delta DE until you get closer to the fractal?  


« Last Edit: November 24, 2016, 04:48:04 PM by M Benesi » Logged

mclarekin
Fractal Senior
******
Posts: 1739



« Reply #37 on: January 26, 2016, 08:16:53 AM »

@M.Benesi, thanks for explanations. As we all know, I need as much help as I can get. grin

Quote
  What happens when you do DeltaDE combined with the modified DE I introduced?
I have been thinking more work is needed in this area..  It is frustrating when you cannot get a good render of a real interesting fractal.

@Buddhi.  Thanks for the information, and it's good to see you being active at the forums, sharing your knowledge smiley smiley smiley
Logged
Pages: 1 2 [3]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Escape-time LRIFS Programming David Makin 11 9236 Last post March 22, 2010, 04:05:57 PM
by kram1032
Kaleidoscopic (escape time) IFS Sierpinski Gasket « 1 2 ... 9 10 » knighty 138 118496 Last post October 28, 2013, 10:23:48 PM
by Clemensson
Is there anything novel left to do in M-like escape-time fractals in 2d? Mandelbrot & Julia Set « 1 2 ... 22 23 » fracmonk 337 80290 Last post May 11, 2017, 10:12:20 PM
by greentexas
Escape time versions of IFS IFS - Iterated Function Systems msltoe 2 13101 Last post April 18, 2011, 02:54:48 PM
by msltoe
Improving over the escape time map (new) Theories & Research megafiddle 1 1254 Last post November 22, 2013, 03:38:37 AM
by megafiddle

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