Welcome to Fractal Forums

Fractal Math, Chaos Theory & Research => Amazing Box, Amazing Surf and variations => Topic started by: mclarekin on April 17, 2017, 04:45:12 AM




Title: smooth spherical fold
Post by: mclarekin on April 17, 2017, 04:45:12 AM
Implemented but yet to fully test.


Chart shows the effective conditional scaling :
green line standard spherical fold with maxR2 = 1.0 and minR2 = 0.25
red line parabolic spherical fold at  default settings.

Basic code with a couple of options that I added to the c++ version

Code:
double maxScale = transf-> // slider default 4.0   (1/0.25 = 4)
double maxR2 = transf-> // slider default 1.0


double midPoint = (maxScale - 1.0) * 0.5;
double halfMax = maxR2 * 0.5;       
double factor = midPoint / (halfMax * halfMax);       
double m;



//iter loop
double rr = dot(z,z)
// add optional offset forward
// add optional scale
if (rr < halfMax)
{
m = maxScale - (rr * rr) * factor;
z *= m;
Dd *= m;
}
else if (rr < maxR2)
{
m = 1.0 + (maxR2 - rr) * (maxR2 - rr) * factor;
z *= m;
Dd *= m;
}
// add optional offset back



Title: Re: smooth spherical fold
Post by: DarkBeam on April 17, 2017, 07:44:19 PM
heyyy Graeme I made one already some time ago... don't remember well the details :)