I was not able to implement the box foldings an line of separation definition, given in Reply #81. So my research is still based on the Fragment code Kleinian_test15-bis.frag, presented in Reply #23.
I did some simplifications and scale the line of separation, but the fractal set seems compatible to the picture in Reply #55 .
The following images should demonstrate the difference in using the line of separation and using classic box folding. The only image without cut is the classical mandelbox julia without using the line of separation.
Default Kleinian Formula:
public override bool GetBool(double x, double y, double z)
{
double KleinR=1.94;
double KleinI=0.033;
for (int i = 0;i < 44; i++)
{
x = x-Math.Floor(x+0.5);
z = z-Math.Floor(z+0.5);
if ( y >= KleinR*(0.5+0.1*Math.Sin(-2.0*Math.PI*x)) )
{
x = KleinI-x;
y = KleinR-y;
z = -z;
}
double r=x*x+y*y+z*z;
if(r>0)
{
x /= r;
y /= r;
z /= r;
if(r<0.2) return false;
}
x = KleinI + x;
y = KleinR - y;
z = -z;
}
return true;
}
Same code without line of separation:
public override bool GetBool(double x, double y, double z)
{
double KleinR=1.94;
double KleinI=0.033;
for (int i = 0;i < 44; i++)
{
x = x-Math.Floor(x+0.5);
z = z-Math.Floor(z+0.5);
double r=x*x+y*y+z*z;
if(r>0)
{
x /= r;
y /= r;
z /= r;
if(r<0.2) return false;
}
x = KleinI + x;
y = KleinR - y;
z = -z;
}
return true;
}
With boxfold and line of Separation:
public override bool GetBool(double x, double y, double z)
{
double KleinR=1.94;
double KleinI=0.033;
for (int i = 0;i < 44; i++)
{
x=x%2;
z=z%2;
while(Math.Abs(x)>0.5)
{
if(x>0.5) x = 1-x;
if(x<-0.5) x = -1-x;
}
while(Math.Abs(z)>0.5)
{
if(z>0.5) z = 1-z;
if(z<-0.5) z = -1-z;
}
if ( y >= KleinR*(0.5+0.1*Math.Sin(-2.0*Math.PI*x)) )
{
x = KleinI-x;
y = KleinR-y;
z = -z;
}
double r=x*x+y*y+z*z;
if(r>0)
{
x /= r;
y /= r;
z /= r;
if(r<0.2) return false;
}
x = KleinI + x;
y = KleinR - y;
z = -z;
}
return true;
}
With boxfold (Mandelbox Julia with scale=1):
public override bool GetBool(double x, double y, double z)
{
double KleinR=1.94;
double KleinI=0.033;
for (int i = 0;i < 44; i++)
{
x=x%2;
z=z%2;
while(Math.Abs(x)>0.5)
{
if(x>0.5) x = 1-x;
if(x<-0.5) x = -1-x;
}
while(Math.Abs(z)>0.5)
{
if(z>0.5) z = 1-z;
if(z<-0.5) z = -1-z;
}
double r=x*x+y*y+z*z;
if(r>0)
{
x /= r;
y /= r;
z /= r;
if(r<0.2) return false;
}
x = KleinI + x;
y = KleinR - y;
z = -z;
}
return true;
}