Logo by bib - 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. January 19, 2019, 02:34: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 ... 4 5 [6] 7   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: Cross Menger!? Can anyone do this?  (Read 5488 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


« Reply #75 on: November 12, 2016, 08:59:06 AM »

But isn't Tglad fold exactly the Mandelbox fold? Doh  cheesy
Aldo rotate back should only ripristinate coords multiplying by the same rot matrix as before but translated (switch rows with columns).
This is a nice framework for mostly every transformer imaginable though
🤓
« Last Edit: November 12, 2016, 09:24:25 AM by DarkBeam » Logged

No sweat, guardian of wisdom!
3dickulus
Global Moderator
Fractal Senior
******
Posts: 1558



WWW
« Reply #76 on: November 12, 2016, 06:18:12 PM »

@mclarekin me thinks FragM needs a mclarekin folder in the /Examples/ wink
Logged

Resistance is fertile...
You will be illuminated!

                            #B^] https://en.wikibooks.org/wiki/Fractals/fragmentarium
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #77 on: November 12, 2016, 09:12:56 PM »

mclarekin, thank you for explanation! I found some time for fix .frag. Here rotated CM with prismshape and some modes for dotScale




* cm_prism.zip (10.27 KB - downloaded 74 times.)
Logged

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



« Reply #78 on: November 13, 2016, 01:06:15 AM »

@darkbeam
I am not really sure but I thought  that Tglad fold was the same as Mbox at default setting and when the Mbox  limit:value ratio was at 1:2.  huh?  But when straying from this ratio (when using the MboxFold in an Mbox formula)  I think can cause nasty cuts therefore 99% of the time Tglads fold is the easiest one to use.

I thought, "ripristinate! is that a typo?" but it is a real word . smiley Yeah, i assumed that was the correct way the transform should work, and had only added in the second rotation controls as a checkBox option.  Then I decided to delay figuring out if I could do a non-trig  back rotation. 


When I have time I may test adding this fold (from M3D somewhere?), to the UI :-

  z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold)






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



« Reply #79 on: November 13, 2016, 02:12:46 AM »

I  like these patterned surfaces that come out of mixing  all these IFS foldings as per attached image (there are still areas of  menger sponge inside as well.)  So now that I have Folding Tetra3D, Octo,  Menger and all this Cross Menger code, I can explore a lot more possibilities, and they are FAST to render. smiley  (and there is Knighty's KIFS UI in Mandelbulber that can do much more if you learn how to use it.)


One of FRagmentariums advantages is in being able to have all these in a .frag for exploring , and when you find  a good place, just simply //comment out the transforms you have decided not to use. I currently  have a UI setup in this order : -

PrismShape
Rotation
CMT
CMkifs
Benesi T1
Benesi T1mod (a Tglad fold inside)
FabsMulti
Menger Sponge
 there is more rotations and other transforms to be added, but it already too big and clumsy .  sad



* cmKIFS tetra3D 007 800.jpg (203.7 KB, 800x600 - viewed 161 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #80 on: November 13, 2016, 02:27:27 AM »

Attached image show what the Benesi t1Mod and the Fabs Multi transforms on the UI.  

Fabs Multi lets me explore various fabs() folds, but with the cost of the extra checkBoxes and maths.


* fabs multi.jpg (89.61 KB, 663x570 - viewed 157 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #81 on: November 13, 2016, 02:39:35 AM »

@crist. Cool, checking out the dot modes. 

For prismShape2 I have added two more offset options. This allows me to replicate the variations I had between  earlier versions.

      t = max(0.0, dot1);
      if (fractal->transformCommon.functionEnabledBxFalse)
      {
         z.x -= t * -SQRT_3
                   - (fractal->transformCommon.offset0);

      }
      else
      {
         z.x -= t * -SQRT_3;
      }
      z.y = fabs(z.y - t);
      if (z.y > z.z)
      {
         temp = z.y;
         z.y = z.z;
         z.z = temp;
      }
      if (fractal->transformCommon.functionEnabledByFalse) z.y -= fractal->transformCommon.offset105;

      z -= gap * CVector3(SQRT_3_4, 1.5, 1.5);
Logged
Crist-JRoger
Fractal Fertilizer
*****
Posts: 389



WWW
« Reply #82 on: November 13, 2016, 02:44:13 PM »

mclarekin, i'm newbie in programming, more interested in fractal rendering ) So i really don't understand your code
This formula z = fold2 - fabs( fabs(z + fold) - fold2) - fabs(fold) What is fold and fold2?
Logged

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



« Reply #83 on: November 14, 2016, 01:39:12 AM »

@crist
These questions should be directed to Darkbeam. police grin grin grin

But I will try to answer smiley

This function contains two folds. Fold & fold2 are user defined variable parameters, usually a double or vect3.


This is the mapping or maths sequence where fold & fold2 can be pos or neg numbers

x' = fold2 - fabs( fabs(x + fold) - fold2) - fabs(fold)


broken into steps:


result' =  (x + fold);   shift x  by distance fold

result' = fabs(result);  fold the result, (fold the plane, all neg numbers are mapped over to positive)

result' = ( result - fold2); shift the result by distance fold2

result' = fabs(result);  again all negative numbers are folded to positive

x' = fold2 - result - fabs(fold);  final shifts.

fold is the number used to "shift / offset / translate / add_additionConstant" before doing the "absolute  function"

So I was thinking of trialling this in between a rotate_forward and a rotate_back. I think I already have included it as an amazing_surf fold option (it could be added to Tim Emit's amazing surf frag  set up.)
« Last Edit: November 14, 2016, 01:50:09 AM by mclarekin, Reason: attempt at clarifcation. » Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #84 on: November 16, 2016, 11:36:26 AM »

Please ignore, answered the wrong thread, my bad! embarrass Seems the topic was split while I was typing :}
« Last Edit: November 16, 2016, 11:47:52 AM by Sabine62 » Logged

sabine62.deviantart.com
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #85 on: November 30, 2016, 12:22:49 PM »

 I have just tried this Iteration Weight Transform with the prismShapeCMT, and it works well, ( as it does with menger sponge,, and   sometimes with other fractals, but I have  :hmh:forgotten).
The function occasionally can improve the DE quality
I generally put it as the last transform in a loop

// iteration weight transform.
// Influence fractal based on the weight of Z values at specified iterations
// intA & intB are positive int, (0,0,99)
// vec3 offsetIw1 & 2    slider (-5,0,5)
// float scaleIw     guessing slider (0,1,3)

if (iterW) {
   vec3 zA, zB;

   if (i == intA)
   {
      zA = z;
   }
   if (i == intB)
   {
      zB = z;
   }
   z = (z * scaleIw) + (zA * offsetIw1) + (zB * offsetIw2);
   Dd *= scaleIw;
   //aux.r_dz *= scaleIw;
}


* prismShape2 iterWeig.jpg (120.53 KB, 580x580 - viewed 163 times.)

* prismShape2 iterWeiga1.jpg (116.07 KB, 580x580 - viewed 150 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #86 on: December 21, 2016, 10:44:56 AM »

I have been testing the DotModes in the PrismShape. There is some good things hidden in the combinations.  smiley

Having the seperate bool  abs functions allows for more combinations (not all prismshape).  DE can get a bit bad with some.

These are the six DotModes I have tested .  My  loop was PrismShape, Octo, SphereFold, Rotation, Menger


Code:
if(FabsXMode == 1) z.x = fabs(z.x);

if(FabsYMode == 1) z.y = fabs(z.y);

if(FabsZMode == 1) z.z = fabs(z.z);


if(DotMode==0) {
float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.x -= t * -SQRT_3;
z.y = fabs(z.y - t);
}
if(DotMode==1) {
float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.y -= t * -SQRT_3;
z.x = fabs(z.x - t); // x y swap
}

if(DotMode==2) {
float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.z -= t * -SQRT_3;
z.y = fabs(z.y - t);  // z.z z.y swap
}
if(DotMode==3) {
float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.y -= t * -SQRT_3;
z.z = fabs(z.z - t);  // z.z z.y swap
}

if(DotMode==4) {
float dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.zy -= t * -SQRT_3;
z.xy = fabs(z.yx - t);  //x y swap and other things
}

if(DotMode==5) {
float dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * scaleP;
float t = max(0.0, dot1);
z.xy -= t * -SQRT_3;
z.yz = fabs(z.yz - t);  //x y swap and other things
}


* Prism Dot Test 1p aaa3 1200.jpg (245.98 KB, 1000x692 - viewed 142 times.)
Logged
mclarekin
Fractal Senior
******
Posts: 1739



« Reply #87 on: January 07, 2017, 09:33:51 AM »

Finally finished PrismShape2.  Attached hybrid image is CMT (3 iters) Mbox (the rest)

Code:
/**
 * Menger Prism Shape2
 * from code by Knighty
 * http://www.fractalforums.com/fragmentarium/
 * cross-menger!-can-anyone-do-this/msg93972/#new
 */
void MengerPrismShape2Iteration(CVector3 &z, int i, const cFractal *fractal, sExtendedAux &aux)
{
CVector3 gap = fractal->transformCommon.constantMultiplier000;
double t;
double dot1;
if (fractal->transformCommon.functionEnabledSwFalse)
{
z = CVector3{-z.z, z.x, z.y};
}
if (fractal->transformCommon.functionEnabledx && i >= fractal->transformCommon.startIterationsP
&& i < fractal->transformCommon.stopIterationsP1)
{
if (fractal->transformCommon.functionEnabledCxFalse)
{
z.x = fabs(z.x);
}
if (fractal->transformCommon.functionEnabledCy)
{
z.y = fabs(z.y);
}
if (fractal->transformCommon.functionEnabledCz)
{
z.z = fabs(z.z);
}
double tempOff = (fractal->transformCommon.offset0 + SQRT_3_4d2);
switch (fractal->combo.modeA)
{
case sFractalCombo::mode0:
default:
dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.x -= t * -SQRT_3 - tempOff;
z.y = fabs(z.y - t);
break;
case sFractalCombo::mode1:
dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.y -= t * -SQRT_3 - tempOff;
z.x = fabs(z.x - t); // x y swap
break;
case sFractalCombo::mode2:
dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.z -= t * -SQRT_3 - tempOff;
z.y = fabs(z.y - t); // z y swap
break;
case sFractalCombo::mode3:
dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.y -= t * -SQRT_3 - tempOff;
z.z = fabs(z.z - t); // z y swap
break;
case sFractalCombo::mode4:
dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.y -= t * -SQRT_3 - tempOff;
z.z -= t * -SQRT_3 - tempOff;
z.x = fabs(z.x - t); // x y swap and other things
z.y = fabs(z.y - t);
break;
case sFractalCombo::mode5:
dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.x -= t * -SQRT_3 - tempOff;
z.y -= t * -SQRT_3 - tempOff;
z.y = fabs(z.y - t); // x y swap and other things
z.z = fabs(z.z - t);
break;
case sFractalCombo::mode6:
dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.y -= t * -SQRT_3 - (fractal->transformCommon.offset0);
z.z -= t * -SQRT_3 - (fractal->transformCommon.offset0);
z.x = fabs(z.y - t); // x y swap and other things and swizzle
z.y = fabs(z.x - t);
break;
case sFractalCombo::mode7:
dot1 = (z.z * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scale;
t = max(0.0, dot1);
z.x -= t * -SQRT_3 - (fractal->transformCommon.offset0);
z.y -= t * -SQRT_3 - (fractal->transformCommon.offset0);
z.y = fabs(z.z - t); // x y swap and other things and swizzle
z.z = fabs(z.y - t);
break;
}

if (z.y > z.z) swap(z.y, z.z);
z.y -= fractal->transformCommon.offsetB0;

z -= gap * CVector3(SQRT_3_4, 1.5, 1.5);

if (z.z > z.x) swap(z.z, z.x);

if (fractal->transformCommon.functionEnabledyFalse)
{
z.y = max(0.0, z.y) * fractal->transformCommon.scaleA1;
z.z = max(0.0, z.z) * fractal->transformCommon.scaleB1;
}
if (fractal->transformCommon.functionEnabledzFalse)
{
if (z.x >= 0.0)
{
z.y = max(0.0, z.y) * fractal->transformCommon.scaleA1;
z.z = max(0.0, z.z) * fractal->transformCommon.scaleB1;
}
}
z *= fractal->transformCommon.scale1;
aux.DE *= fractal->transformCommon.scale1;
aux.DE *= fractal->transformCommon.scaleC1;
}

if (fractal->transformCommon.functionEnabledXFalse
&& i >= fractal->transformCommon.startIterationsA
&& i < fractal->transformCommon.stopIterationsA)
{ // CrossMengerTrick
double dd = aux.DE;
z.y = fabs(z.y);
z.z = fabs(z.z);
if (fractal->transformCommon.functionEnabledCyFalse)
{
z.x = fabs(z.x);
}
dot1 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scaleD1;
double t = max(0.0, dot1);
z.x -= t * -SQRT_3;
if (fractal->transformCommon.functionEnabledBzFalse)
{
z.y = fabs(z.y) - t;
}
else
{
z.y = fabs(z.y - t);
}
z.x -= SQRT_3_4;
double dy = 0.0;
double dz = 0.0;
if (z.y > 0.5 && z.z > 0.5)
{
dy = 1.5;
dz = 1.5;
}
else if ((z.y - 1.5) * (z.y - 1.5) + z.z * z.z < z.y * z.y + (z.z - 1.5) * (z.z - 1.5))
{
dy = 1.5;
}
else
dz = 1.5;

z.y -= dy;
z.z -= dz;
z *= fractal->transformCommon.scaleA3;
aux.DE *= fractal->transformCommon.scaleA3;
z.y += dy;
z.z += dz;
z.x += SQRT_3_4;

if (fractal->transformCommon.functionEnabledFalse)
{
dd *= 0.33333333333333333333333333333 * fractal->transformCommon.scaleE1;
z *= dd;
aux.DE *= dd;
}
aux.DE *= fractal->transformCommon.offset1; //.DE tweak cross menger trick part
}
if (fractal->transformCommon.functionEnabledPFalse)
{
z.x = fabs(z.x + fractal->transformCommon.offset) + fractal->transformCommon.offsetC0;
}

// void KIFS(vec3 z)
//{//Pure KIFS... almost correct

if (fractal->transformCommon.functionEnabledKFalse
&& i >= fractal->transformCommon.startIterationsB
&& i < fractal->transformCommon.stopIterationsB)
{
if (fractal->transformCommon.functionEnabledCzFalse)
{
z.x = fabs(fractal->transformCommon.offset - z.x ) + fractal->transformCommon.offsetC0;
}

z.y = fabs(z.y);
z.z = fabs(z.z);

double dot2 = (z.x * -SQRT_3_4 + z.y * 0.5) * fractal->transformCommon.scaleF1;
double t = max(0.0, dot2);

z.x -= t * -SQRT_3;
z.y = fabs(z.y - t);

if (z.y > z.z) swap(z.y, z.z);

z.y = fabs(z.y - 0.5) + 0.5;

z -= CVector3(0.5 * SQRT_3, 1.5, 1.5);

z *= fractal->transformCommon.scaleB3;
aux.DE *= fractal->transformCommon.scaleB3;


z += CVector3(0.5 * SQRT_3, 1.5, 1.5);
}


* CMT Mbox.jpg (186 KB, 1000x750 - viewed 138 times.)
Logged
Sabine
Fractal Fertilizer
*****
Posts: 373



WWW
« Reply #88 on: January 07, 2017, 07:40:12 PM »

Congratulations, mclarekinA Beer Cup A Beer Cup A Beer Cup



Logged

sabine62.deviantart.com
Tim Emit
Conqueror
*******
Posts: 111



https://www.facebook.com/
WWW
« Reply #89 on: January 09, 2017, 07:41:44 PM »

excellent  smiley
Logged
Pages: 1 ... 4 5 [6] 7   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
cross 2D Art ramblerette 0 570 Last post March 29, 2009, 02:28:49 PM
by ramblerette
At the Cross Images Showcase (Rate My Fractal) John Smith 0 392 Last post June 10, 2012, 10:43:53 PM
by John Smith
Cross JWildfire Gallery thargor6 1 205 Last post December 06, 2012, 04:04:30 AM
by Pauldelbrot
3D Printed Cross Sections of the Menger Sponge Format, Printing & Post Production tit_toinou 6 2546 Last post April 29, 2013, 03:35:56 PM
by cKleinhuis
Cross Mandelbulb3D Gallery MichaelWGioffredi 0 208 Last post April 22, 2015, 11:33:06 AM
by MichaelWGioffredi

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.122 seconds with 28 queries. (Pretty URLs adds 0.009s, 2q)