Title: Extension of "folding" Post by: David Makin on January 05, 2012, 12:05:28 PM Hi, whilst trying this:
http://www.fractalforums.com/programming/interesting-result-from-well-known-idea-on-ff/ (http://www.fractalforums.com/programming/interesting-result-from-well-known-idea-on-ff/) I got an an idea - my above 2D algorithm and the Mandelbox etc. use mathematical folding - has anyone tried mathematical pleating yet ? Am just about to try it in the pattern generator but I'm guessing it will produce interesting results if used instead of (or as well as) folding for Mandelboxes etc. Title: Re: Extension of "folding" Post by: DarkBeam on January 05, 2012, 07:47:04 PM explain this concept ; "mathematical" folding ... is? :alien:
Title: Re: Extension of "folding" Post by: Syntopia on January 05, 2012, 09:23:36 PM Not sure if it is used by mathematicians at all, but here on FF it seems to be a conditional reflection, in either a point, line, or plane (reflect if you are on the wrong side). For instance, x=abs(x), is a fold. Lowe's video is a good illustration: http://sites.google.com/site/mandelbox/what-is-a-mandelbox
Makin: wouldn't a pleating be just the same as the Lowe's boxfold (a double fold)? i.e. either: x = abs(x-1)-abs(x+1)+x, or x = x-abs(x-1)+abs(x+1); Title: Re: Extension of "folding" Post by: bib on January 05, 2012, 09:47:13 PM Folding is basically a symmetry. Not sure if this is an official mathematical term, but it is used by Ian Stewart in his famous book "Does God Play Dice" to explain that the essence of chaos is just to repeat the process "stretch + fold" over and over again, the most simple one being the baker's map. http://en.wikipedia.org/wiki/Baker's_map
This is also what the Mandelbox algorithm does to some extent. Title: Re: Extension of "folding" Post by: DarkBeam on January 05, 2012, 10:30:06 PM If David means abs() folds as a new concept, something must be wrong! It is the oldest concept ever, used almost everywhere around. Waiting for more explanation :)
Title: Re: Extension of "folding" Post by: kram1032 on January 05, 2012, 10:46:35 PM Well, in combination with the thread he linked, I'd say it's an idea I actually had before...
The generic kaleidoscope fractals which work on any polytope, have certain planes defined, to be reflected (or folded) along, as far as I can remember. Now, his idea probably is double-folding, but with a constant offset between the folds. The thread he linked shows how this looks like with random offsets in 2D. Title: Re: Extension of "folding" Post by: Syntopia on January 05, 2012, 11:04:22 PM If David means abs() folds as a new concept, something must be wrong! It is the oldest concept ever, used almost everywhere around. Waiting for more explanation :) I don't think he says that folding is a new concept - as I read it, he talks about extending folding into something called pleating, leaving us wondering whether this is a double fold or something more complex than that :-) But now I am getting curious! Title: Re: Extension of "folding" Post by: David Makin on January 05, 2012, 11:10:29 PM Apologies I just visualised it as folows:
Code: 2 simultaneous folds (at the ends of yyyy) turn this: So a pleat is an exact negative of 2 simultaneous folds - to be honest I hadn't realised anyone was using simultaneous folds - I thought the original 'box just used single consecutive ones - maybe my memory's not what it used to be ;) Also at the moment the pattern generator just uses a single fold per iteration (so just consecutive folding) and I think I'm correct in saying that this is definitely different from a simultaneous double-fold (because in consecutive folding part of the section folded on the first fold gets refolded on the second). In the formula every fold position is random (and is effectively abs() applying it appropriately to positive or negative values) and the max. distance from the origin is gradually decreased until the range stays between -0.5...+0.5 but increasing the number of repetitions still both increases the detail level and changes the pattern. Of course the nice patterns arise from combining the (2D) folding with rotation. Also the formula has the option of adjusting the values so the pattern is no longer rotationally symmetrical around the origin - this is just basically a slight offset applied on each iteration that essentially moves the centre of rotation --ooops *and* folding :) Title: Re: Extension of "folding" Post by: kram1032 on January 06, 2012, 12:43:33 AM slight offset meaning constant?
Sounds interesting. I'm not sure what you mean with all those arrows in your Ascii-folding notation... Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 12:57:52 AM slight offset meaning constant? Sounds interesting. I'm not sure what you mean with all those arrows in your Ascii-folding notation... Nope, it's actually a random - applied at the start of each iteration as follows: if !@p_sym x = x + p[i+512] y = y + p[i+1536] endif It doesn't break any continuity because no matter which pixel it is the random table (p[2048]) always returns the same value (0 to 1) on each iteration (i). The arrows denote *the original* positive direction - as in all point right prior to folding - you have to imagine it as a side view of a piece of paper or cloth being folded/pleated, Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 01:34:18 AM Here's one with the rotation symmetry removed due to the "slight move" per iteration....
(http://nocache-nocookies.digitalgott.com/gallery/9/141_06_01_12_1_32_35.jpeg) http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9803 (http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9803) Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 01:46:06 AM Just to add - these render really fast - in fact this one renders in almost exactly the same time as the standard UF default Mandelbrot set at the default location (in multi-pass with periodicity off) with max iterations set to a measly 100 and bailout 128.
In fact even putting my detail level parameter up from 8 to 32 which means that a minimum extra 24 iterations are performed *per pixel* only took the time on my system from 0.3secs to 0.48secs (for a render within UF at 928*696). Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 02:50:22 AM OK, I really shouldn't think and post when I'm over-tired (have done that two days running now).
Of course my code is not applying the folds *consecutively* for a single point - with visualising things as a whole line/piece of paper/curtain I was thinking the code operated on the whole whereas of course it only operates on one point at a time and doing a *single* fold on that point based on it being left or right (or above/below) the two-fold region *is* doing the folding in a simultaneous manner with respect to the whole and so equivalent to a pleat. However it made me realise that I could add a repeat count parameter on the folding ;) Title: Re: Extension of "folding" Post by: kram1032 on January 06, 2012, 04:48:00 AM really nice stuff :)
Any chance to see that in 3D? Also, if folding basically is a reflection on a line (in 2D) or a plane (in 3D), what about adding other kinds of reflections? Spherical ones, for instance... Or you could try parabolic reflections if that works. Heh... maybe you could even do some kind of fractal origami, figuring out certain Origami-pieces and how they are folded, and coding that into a folding behavior that might terminate after the "figure is done folding" or maybe it starts over... Possibly we could come up with a "mathematical" version of folding a piece of paper into a cusp. (I hope I'm describing it correctly, here... What I mean is a common origami trick where you get a round shape from a fold by pressing on the fold... Not sure if that would make any sense in this kind of thing though) Title: Re: Extension of "folding" Post by: bib on January 06, 2012, 09:22:46 AM Hi Dave,
Sorry if I missed the information, is that formula already in the UF database? Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 12:31:04 PM Nope - am still "tweaking" - may take a few days as its (useful) potential just grows as I try each idea - so far everything I add produces some great additional potential *without* any large performance hits - it's quite refreshing, usually things you add are either fast but useless or brilliant but incredibly slow !!
Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 12:35:33 PM really nice stuff :) Any chance to see that in 3D? Thanks ;) 3D ? Not so straightforward as in the interesting parts the patterns are continuous (though due to range limitations the whole pattern areas are bounded), you'd have to think very carefully about how to define a surface and more importantly how to efficiently find it !! Edit: Of course converting to height-fields would be both possible and interesting ;) As to other folding types - will be investigating over the weekend ;) Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 12:41:23 PM I did try adding repeated folds/pleats prior to the rotation but repeating more than twice got very boring (basically the folding becomes too efficient reducing the variety) so the formula now simply has a user parameter to specify just one or two folds/pleats per iteration - will post an interesting result of using 2 instead of 1 this evening, now I have to get to work (am late because it's mum's birthday - she's 74) ttfn
Title: Re: Extension of "folding" Post by: David Makin on January 06, 2012, 11:14:49 PM Here's "Bits'n'pieces" with two pleats per iteration applied prior to the rotation - without the extra pleat the result is akin to http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9772 (http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9772)
(http://nocache-nocookies.digitalgott.com/gallery/9/141_06_01_12_11_08_57.jpeg) http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9817 (http://www.fractalforums.com/index.php?action=gallery;sa=view;id=9817) Title: Re: Extension of "folding" Post by: David Makin on January 09, 2012, 11:26:28 AM The first released version of "Folded Patterns" is now uploaded to the UF formula database in mmf5.ucl - it really needs re-writing as a plug-in to make it more useful i.e. so it can be used for orbit trapping etc.
At the moment as it's an old-style colouring it's only useful for those main formulas that will work with the colourings that work for mt.ufm:pixel and similar. Here's an example UPR (there are 2 more on the UF list for those who are members): Code: Fractal1 {Another: Code: Fractal2 {Title: Re: Extension of "folding" Post by: kram1032 on January 09, 2012, 06:55:09 PM that image looks a lot better than your previous attempt, at least to my eye.
3D could possibly use different special material settings like continuous IoR, simple transparency, using maximum/minimum or equal values to define smooth implicit surfaces, varying volume materials... Lots of different variants how this could be displayed in 3D. Some maybe more interesting, others simpler... Heh, you could try some experiments like defining a cut-out surface of the Mbrot by cutting it with an implicit surface created by this process... :) Title: Re: Extension of "folding" Post by: David Makin on January 09, 2012, 08:12:19 PM that image looks a lot better than your previous attempt, at least to my eye. 3D could possibly use different special material settings like continuous IoR, simple transparency, using maximum/minimum or equal values to define smooth implicit surfaces, varying volume materials... Lots of different variants how this could be displayed in 3D. Some maybe more interesting, others simpler... Heh, you could try some experiments like defining a cut-out surface of the Mbrot by cutting it with an implicit surface created by this process... :) Hmmm - but I don't think there's an easy distance estimation so you'd be stuck with essentially brute-force rendering, not exactly optimum ! Better to use the formula for non-random textures I think :) Title: Re: Extension of "folding" Post by: kram1032 on January 10, 2012, 04:38:29 PM Wouldn't the distance estimation just be what ever technique you currently use as colour gradient but set a certain value of that, maybe with a delta to reduce possible artifacts, to a single value?
I'd guess to colour this stuff, you map the values from 0 to 1? So if you say "blah" = .5, you should get the values half way in between? Or are you just operating on a gradient that you then transform by means of this fractal? In THAT case, you could try to use an image as transformation target... Or in the 3D case, some kind of voxel-structure, like, for instance, the classic mbox or mbulb or what ever variation. Title: Re: Extension of "folding" Post by: David Makin on January 10, 2012, 08:34:46 PM But there is no escape-time here, the entire thing is convergent so standard DE won't work - plus the values (say 0 to 1) are multiply wrapped resulting (in 3D terms) in a forest of usually similar sized disconnected objects (if you specify some range as "solid") - far less interesting than the Mandelbox for instance.
I guess it my be workable as a convergent bailout in iteration/distance estimation terms though I don't see how given that every fold is completely random. In short I think the results are best used as stand-alones or as textures (of whatever kind). Title: Re: Extension of "folding" Post by: kram1032 on January 11, 2012, 08:07:43 PM I see, so it will mostly be useful for 2D...
Hmm, did you try different kinds of randomness? Like for instance, what about the next fold is selected in a brownian motion style way, where the new fold coordinates are chosen by only slightly offsetting the previous ones, both location and rotation... Or what about randomly applying a couple of fixed patterns, rather than a totally random process? Title: Re: Extension of "folding" Post by: David Makin on January 12, 2012, 01:00:47 AM I see, so it will mostly be useful for 2D... Hmm, did you try different kinds of randomness? Like for instance, what about the next fold is selected in a brownian motion style way, where the new fold coordinates are chosen by only slightly offsetting the previous ones, both location and rotation... Or what about randomly applying a couple of fixed patterns, rather than a totally random process? :) Am planning on trying all those and more - but haven't done a line of code in the last 24 hours due to feeling like I've been hit by a bus - yesterday my nose was running like a tap, today it's almost dried up but I still feel rotten and spent most of the day just watching TV (or at least TV over the net) as I'm still having trouble concentrating on anything..... Title: Re: Extension of "folding" Post by: kram1032 on January 31, 2012, 10:10:49 PM Oh, I've only seen that now!
I hope, enough time has passed to assume correctly, that at least the worst part of that is over. Despite that, even if late: Get well soon! Title: Re: Extension of "folding" Post by: David Makin on February 01, 2012, 12:07:50 AM :) Am much better but (as some may have noticed) I've been spending more time playing with my camera recently...http://makinmagic.deviantart.com/ (http://makinmagic.deviantart.com/) I will be adding more to both the folding/pattern formula and the image tiling formula shortly - including an alternative version of the tiling formula that will do the same thing but essentially with live generated layers rather than loaded images.....oh - and a simplified alternative that may actually be superior (at least in terms of creating say surface textures for use in 3D or porting the code to do the same in shaders i.e. surface detail with texture-source-less tiled textures). |