|
|
"Tor Olav Kristensen" <tor### [at] TOBEREMOVEDgmailcom> wrote:
> I had forgotten about the supershapes, so I searched for them
> - and ended up at one of Paul Bourke's web pages again:
> http://paulbourke.net/geometry/supershape/
>
> I see now that there's two files there that I've made; ss_macro1.inc &
> example1.pov
> - So apparently I have been experimenting with them once...
>
> It seems that they are commonly made with parametric meshes. Perhaps it is
> possible to model some of them as isosurfaces. But that would be very slow, so I
> think I'll wait some years (for more computing power) before looking into that.
I did it in 8/2017 with isosurfaces, so I would imagine you could do an
approximation of some sort to speed it up.
Here's my see-them-all scene if you wanted some code to to run a quick test
scene:
#version 3.71;
global_settings {
assumed_gamma 1.0
}
#include "colors.inc"
#declare m = 7; // number of lobes
#declare n1 = 5;
#declare n2 = 5;
#declare n3 = 5;
#declare a = 1;
#declare b = 1;
#declare M = 10; // iterations
#declare AL = 20;
#declare L = 0.05;
cylinder {<-AL*4, 0, 0>, <AL*4, 0, 0>, L pigment {Red} no_shadow}
cylinder {<0, -AL*4, 0>, <0, AL*4, 0>, L pigment {Green} no_shadow}
cylinder {<0, 0, -AL*4>, <0, 0, AL*4>, L pigment {Blue} no_shadow}
camera {
location <M*4, 0, -75>
look_at <0, 0, 0>
right x*image_width/image_height
up 1*y
}
#declare LS = <M*4, M*2, -100>;
light_source {LS color White}
cylinder {LS, <0, 0, 0>, 0.01 pigment {White} no_shadow}
#declare CB = 4;
#for (n1, 1, M)
#for (n2, 1, M)
#for (m, 1, M)
isosurface {
function {
pow (
pow (abs (cos (0.25 * m * acos (y/sqrt(x*x+y*y)) * abs(y)/y) / a), n2) +
pow (abs (sin (0.25 * m * acos (y/sqrt(x*x+y*y)) * abs(y)/y) / b), n3)
, (1/n1)
)
//* sqrt (x*x+y*y) - 1 }
* sqrt ((x*x)+(y*y)+(z*z)) - 1
}
contained_by { box { <-CB, -CB, -CB>, <CB, CB, CB> } }
accuracy 0.01
max_gradient 12
scale <1, 1, 1>
#declare Hue = m * (360/M);
texture {pigment {color CHSV2RGB (rgb <Hue, 1, 1>)} finish {specular
0.2}}
translate -x*M
translate x*m*3
translate y*M
translate -y*n2*3
translate -z*M
translate z*n1*3
}
#end // end for m
#end // end for n2
#end // end for n1
Post a reply to this message
|
|