POV-Ray : Newsgroups : povray.newusers : Isosurface blemished : Re: Isosurface blemished Server Time
15 May 2024 21:18:36 EDT (-0400)
  Re: Isosurface blemished  
From: John Greenwood
Date: 28 Jan 2014 05:30:00
Message: <web.52e785ac5239c061a7cafab50@news.povray.org>
Alain <kua### [at] videotronca> wrote:

> > I tried to use an isosurface with a moderately complex formula but got very
> > weird results, so I started with a working example with the object of adding the
> > complexity bit by bit.
> >
> > I started with the code below and found I was getting black features on the
> > surface. There are five versions of the function line, the first renders ok but
> > the rest give increasingly worse results.
> >
> > #version 3.7;
> > global_settings { assumed_gamma 1.0 }
> > #default{ finish{ ambient 0.1 diffuse 0.9 }}
> >
> > #include "colors.inc"
> > #include "functions.inc"
> >
> > //-------------------------------------------
> >
> > #declare CamLoc = < 0, 0,-10>;
> >
> > camera {
> >   location CamLoc
> >          right     x*image_width/image_height
> >   look_at < 0, 0, 0>
> >   angle 42
> > }
> >
> > light_source {CamLoc color White*0.35}
> > light_source {<-50, 150,-75> color White}
> >
> > background { color rgb<1,1,1>*0.35 }
> >
> >
> > /*
> > box {<-4,-3, 1>, < 4, 3, 2>
> >   texture {
> >    pigment {checker color rgb < 0.05, 0, 0.35>, color White}
> >    finish {ambient 0 diffuse 1}
> >   }
> > }
> > */
> > //-------------------------------------------
> > #local Yo = 0.08;
> > #local Zo = .635;
> > #local Xa = 0.75;
> > #local Yb = 1.6;
> > #local Rr = 2.560;
> > #local Ko = 0.23;
> >
> >
> > #declare IsoFinish =
> > finish {
> >   ambient 0 diffuse 1
> >   specular 1 roughness 0.02
> >   brilliance 2
> > }
> >
> > #declare  Shape =
> > isosurface {
> > // function {sqrt(x*x + y*y + z*z) - 1}
> > // function {sqrt(pow((x/Xa),2) + pow((y),2) + z*z) - 1}
> > // function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + z*z) - 1}
> > // function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + pow((z/Zo),2)) - 1}
> >    function {sqrt(pow((x/Xa),2) + pow((y/Yb),2) + (z/Zo)*(z/Zo)) - 1}
> >   threshold 0
> >   contained_by {box {<-1,-1,-1>, < 1, 1, 1>}}
> >   texture {
> >    pigment {color  rgb<0.8,0,0>}
> >    finish {IsoFinish}
> >           }
> >          }
> >   object {Shape rotate <0, 0, 45> translate <-2, 2, 0>}
> >   object {Shape rotate <0, 45, 0> translate <-2, 0, 0>}
> >   object {Shape rotate <0, 45, 45> translate <-2, -2, 0>}
> >
> >   object {Shape rotate <-45, 0, 0> translate <0, 2, 0>}
> >   object {Shape rotate <0, 0, 0> translate <0, 0, 0>}
> >   object {Shape rotate <45, 0, 0> translate <0, -2, 0>}
> >
> >   object {Shape rotate <45, 45, 45> translate <2, 2, 0>}
> >   object {Shape rotate <0, -45, 0> translate <2, 0, 0>}
> >   object {Shape rotate <45, 45, 0> translate <2, -2, 0>}
> >
> >
> >
> >
>
> Check your max_gradient.
> For the basic shape, the default of 1.2 seems to be enough.
> For the others, it's obviously to low. Take a look at the post render
> messages. If the max_gradient is to low, there will be a message
> informing you about the fact. It looks like:
> Max_gradient found was 50.24888, but max_gradient was set to 1.2. Your
> isosurface may contain holes. Adjust max_gradient ....
>
> In the isosurface definition, add:
> max_gradient <Value>
> where value is a little smaller than the reported max_gradient.
>
>
>
> Alain

That has fixed it.
Thanks
John


Post a reply to this message

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