POV-Ray : Newsgroups : povray.advanced-users : isosurface: Does the order of multiple functions matter? : Re: isosurface: Does the order of multiple functions matter? Server Time
23 Jun 2024 03:18:10 EDT (-0400)
  Re: isosurface: Does the order of multiple functions matter?  
From: Kenneth
Date: 28 Jan 2023 10:20:00
Message: <web.63d53bc39b90547b9b4924336e066e29@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:

>
> For multiplication of functions, I readily agree. It's the addition of functions
> that has me puzzled...
>
> I guess I should set up a much-simplified test with maybe two functions, and
> switch them around to see...

Well, I did the test. With *three* simple functions! To make a long story short:
The order of the functions does not matter. Perhaps I should have expected that,
although it wasn't obvious to my way of thinking :-(

So the bigger question of how to easily switch them around is... of no
importance, ha. Sorry for the wasted brain power, lads. I'm actually not
disappointed-- it at least makes my code simpler!

Thanks for the comments and suggestions though; they always get me to think more
deeply.

In case you want to try the quick test (no need for 'high-quality' settings
here):
-----------
#declare BUMPS_F =
function{pattern{bumps scale .2}}

#declare GRANITE_F =
function{pattern{granite scale 3}}

#declare SIN_F = function(x){sin(7*pi*x)}

isosurface{
 function { sqrt(pow(x,2)+pow(y,2)+pow(z,2))-.7 // sphere

          // switch these around...
            + BUMPS_F(x,y,z)*.5

            - GRANITE_F(x,y,z)*.5

            - SIN_F(x)*.2

  }

 threshold 0
 accuracy .01
 max_gradient 8

contained_by{box{-1.1,1.1}}
pigment{ rgb 1}
}


Post a reply to this message

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