POV-Ray : Newsgroups : povray.advanced-users : isosurface: Does the order of multiple functions matter? : Re: isosurface: Does the order of multiple functions matter? Server Time26 Mar 2023 22:02:25 EDT (-0400)
 Re: isosurface: Does the order of multiple functions matter?
 From: Kenneth Date: 28 Jan 2023 10:20:00 Message:
```
{
"@context": "https://schema.org",
"@type": "DiscussionForumPosting",
"@id": "#web.63d53bc39b90547b9b4924336e066e29%40news.povray.org",
"headline": "Re: isosurface: Does the order of multiple functions matter?",
"dateCreated": "2023-01-28T15:20:00+00:00",
"datePublished": "2023-01-28T15:20:00+00:00",
"author": {
"@type": "Person",
"name": "Kenneth"
}
}
"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