POV-Ray : Newsgroups : povray.beta-test : Isosurface problem? Server Time
18 Apr 2024 20:11:27 EDT (-0400)
  Isosurface problem? (Message 1 to 3 of 3)  
From: Ger
Subject: Isosurface problem?
Date: 30 May 2013 16:08:43
Message: <51a7b1cb$1@news.povray.org>
Granted, I don't realy know about isosufaces but copied an example from the 
tutorials, but with the following code I don't get a sphere but a perfectly 
smooth cube

// Test code

#version 3.7;

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



light_source {< -400, 1000, -500>, color 1.0  }


global_settings {
    ambient_light 0
    noise_generator 3
    assumed_gamma 1.0
    }



#declare SimpleBlock =
isosurface{
function {
  f_sphere( x, y, z, 2.6) -
    f_noise3d( x, y, z ) * 0.5
    }}


object { SimpleBlock pigment { red 0.5 }}

plane { y, -25 pigment { Gray50 }}

camera {
  location <2, 1.5, -6>
  look_at 0
  direction z *   1.0
  right image_width / image_height * x
}

// End code

Most likely I'm doing something wrong. but fail to see what.
Any hints appreciated.

Running povray 3.7.0 RC7 on opensuse 12.3
-- 
Ger


Post a reply to this message

From: Simon Copar
Subject: Re: Isosurface problem?
Date: 30 May 2013 16:20:01
Message: <web.51a7b3e2ad4021dc65a03f8f0@news.povray.org>
You did not adjust the containing box. Povray does not know in what range you
need to render your isosurface, and you left it on default, which is a box from
-1 to 1 in each direction. This is too small for you sphere, so everything is
clipped by this box.
You need to specify for example:
contained_by {box {<-3,-3,-3>,<3,3,3>} }
in your isosurface block.

You should also look at the max_gradient parameter, if it is too low (if your
function has sharp variations), you will see holes/black spots in your surface.
If it's too high, the render will be slow.


Post a reply to this message

From: Alain
Subject: Re: Isosurface problem?
Date: 31 May 2013 01:40:18
Message: <51a837c2$1@news.povray.org>

>
> Granted, I don't realy know about isosufaces but copied an example from the
> tutorials, but with the following code I don't get a sphere but a perfectly
> smooth cube
>
> // Test code
>
> #version 3.7;
>
> #include "colors.inc"
> #include "functions.inc"
>
>
>
> light_source {< -400, 1000, -500>, color 1.0  }
>
>
> global_settings {
>      ambient_light 0
>      noise_generator 3
>      assumed_gamma 1.0
>      }
>
>
>
> #declare SimpleBlock =
> isosurface{
> function {
>    f_sphere( x, y, z, 2.6) -
>      f_noise3d( x, y, z ) * 0.5
>      }}
>
>
> object { SimpleBlock pigment { red 0.5 }}
>
> plane { y, -25 pigment { Gray50 }}
>
> camera {
>    location <2, 1.5, -6>
>    look_at 0
>    direction z *   1.0
>    right image_width / image_height * x
> }
>
> // End code
>
> Most likely I'm doing something wrong. but fail to see what.
> Any hints appreciated.
>
> Running povray 3.7.0 RC7 on opensuse 12.3
>

The default contained_by for an isosurface is:
box{<-1,-1,-1>,<1,1,1>}

The 2.6 in f_sphere mean that you want a sphere with a radius of 2.6 unit.
By substracting f_noise3d, you push the surface outside by up to 0.5 unit.

This mean that you need a contained_by object larger than the default.

You can use:
sphere{0,3.1}
OR
box{-3.1,3.1}

To improve rendering speed, you need to make the contained_by object as 
tight as possible without clipping the intended shape.

If you get holes in the surface, look at the message after the image is 
completely rendered. You'll get a message informing you about the 
largest gradient found. Adjust max_gradient to that value or a little 
smaller. Often, a value within 5 to 10% lower than the raported value is 
good enough.



Alain


Post a reply to this message

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