POV-Ray : Newsgroups : povray.newusers : Newbie isosurface question : Re: Newbie isosurface question Server Time
29 Jul 2024 12:28:27 EDT (-0400)
  Re: Newbie isosurface question  
From: mwhidden
Date: 13 Dec 2005 16:30:01
Message: <web.439f3cf8dd86f32fc739b8ad0@news.povray.org>
"mwhidden" <nomail@nomail> wrote:
> Thank you sincerely for an excellent response (didactic in all its *best*
> meanings.) Playing with the threshold parameter to the isosurface makes
> your explanation easy to visualize. I'm glad I posted this in the newbie
> forum, and now I see that thinking about isosurfaces is not just a trivial
> step away from simple algebra.

For anyone interested, here is a modified version of the test file posted
above that shows how the isosurfaces for sin(f_th) and cos(f_th) do indeed
differ from x and z where their values are not zero (as pointed out by Mike
Williams).

I have combined the isosurfaces at various thresholds. The height of each
surface on the y-axis is directly proportional to the threshold used for
that surface, and the color changes for clarity (White corresponds to
threshold 0). You can see that the shape of the sin(f_th) and cos(f_th)
surfaces are very different from x and z when the threshold is non-zero.


----------------------

#include "colors.inc"
#include "functions.inc"

camera {
  location  <2.0, 10.5, -10.0>
  look_at   <6.0, 0.0,  0.0>
}

light_source { <-30, 30, -30>  color rgb 1 }
light_source { <-10, 30, -30>  color rgb 1 }

plane { y, 0
  pigment { color rgb <0.7,0.5,0.3> }
}

#declare XTest= function{x}

#declare SinTest= function{ sin(f_th(x,y,z))}

#declare ZTest= function {z}

#declare CosTest= function{ cos(f_th(x,y,z))}

#declare XZTest= function{pow(XTest(x,y,z),2) +
                          pow(ZTest(x,y,z),2) - 1}

#declare SinCosTest= function{ pow(SinTest(x,y,z),2) +
                               pow(CosTest(x,y,z),2) - 1}

#declare Funcs = array[6] {function{XTest(x,y,z)},
                           function{SinTest(x,y,z)},
                           function{ZTest(x,y,z)},
                           function{CosTest(x,y,z)},
                           function{XZTest(x,y,z)},
                           function{SinCosTest(x,y,z)}}

#local i=0;
#while(i < 6)
        #local j=1;
        #while(j >= -1)
                isosurface{
                        function {Funcs[i](x,y,z)}
                        contained_by {box {-1, <1, ((j+1)/1.8) + .2, 1>}}
                        open
                        threshold j
                        evaluate 0.6, 33, .7
                        texture{pigment{color vrotate(<1,1,1>, (j+2)*90)}}
                        translate i*3*x
                }
                difference{ box{-1,1} box {<-2,.1,-2>,2}
                            texture{pigment{color Blue}}
                            translate i*3*x}
        #local j=j-.2;
        #end
        #local i=i+1;
#end


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.