POV-Ray : Newsgroups : povray.newusers : Isosurface blemished Server Time
31 Oct 2024 19:32:31 EDT (-0400)
  Isosurface blemished (Message 1 to 4 of 4)  
From: John Greenwood
Subject: Isosurface blemished
Date: 27 Jan 2014 14:20:00
Message: <web.52e6b14fc312947ea7cafab50@news.povray.org>
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>}


Post a reply to this message

From: Doctor John
Subject: Re: Isosurface blemished
Date: 27 Jan 2014 14:30:27
Message: <52e6b3d3$1@news.povray.org>
On 27/01/14 19:19, John Greenwood 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>}
> 
> 
> 
> 
You've forgotten to specify max_gradient for your isosurface. Try a
value of around 1.6

John
-- 
Protect the Earth
It was not given to you by your parents
You hold it in trust for your children


Post a reply to this message

From: Alain
Subject: Re: Isosurface blemished
Date: 28 Jan 2014 00:07:23
Message: <52e73b0b$1@news.povray.org>

> 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


Post a reply to this message

From: John Greenwood
Subject: Re: Isosurface blemished
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.