POV-Ray : Newsgroups : povray.advanced-users : Isosurface math questions Server Time
2 Nov 2024 11:24:34 EDT (-0400)
  Isosurface math questions (Message 1 to 9 of 9)  
From: David Fontaine
Subject: Isosurface math questions
Date: 16 Dec 1999 17:37:22
Message: <38596824.1F573B72@isd.net>
First of all, how do I make angle-dependent equations, such as helixes,
when isosurface doesn't support atan2?
Second, how do I add or subtract equations, to do stuff like blobbing?

--
David   http://thunder.prohosting.com/~davidf  (ICQ 55354965)
"The paper holds their folded faces to the floor" -Pink Floyd


Post a reply to this message

From: Chris Huff
Subject: Re: Isosurface math questions
Date: 16 Dec 1999 18:00:21
Message: <chrishuff_99-41D518.18005416121999@news.povray.org>
In article <38596824.1F573B72@isd.net>, lfo### [at] isdnet wrote:

> First of all, how do I make angle-dependent equations, such as helixes,
> when isosurface doesn't support atan2?

Um, atan2 is supported-at least, it seems to be in the Multipatch. And 
there are also:
sin  asin  sinh  asinh
cos  acos  cosh  acosh
tan  atan  tanh  atanh
and a few others, these are just the trig functions.
You might want to check out the built in library functions too, there 
are some for making helixes in there.


> Second, how do I add or subtract equations, to do stuff like blobbing?

With the + and - operators. :-)
If you have two functions that are #defined, say MyFuncA and MyFuncB, do 
something like
function {MyFuncA(x, y, z) + MyFuncB(x, y, z)}
Also try using * and & for multiplication and boolean AND.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: Chris Huff
Subject: Re: Isosurface math questions
Date: 16 Dec 1999 18:39:14
Message: <chrishuff_99-8BB908.18394416121999@news.povray.org>
Here is a list of the functions and keywords available(from a template 
menu in MacMegaPOV):
x y z
clock pi
+ - * / ^ & | %

cos() cosh() acos() acosh()
sin() sinh() asin() asinh()
tan() tanh() atan() atanh() atan2(a, b)

abs() ceil() floor() min() max()
sqrt() cub() exp()

noise3d(x, y, z)

degrees() radians()

if(a, b, c)


And an example of mixing functions:
isosurface {
   function {
      (1-sqrt(x^2 + y^2 + z^2))//The spherical function
      - (sin(atan2(x, z)*7 + y*3)*0.15)//a helical function
   }
   threshold 0
   bounded_by{box {<-5,-5,-5>, < 5, 5, 5>}}
   accuracy 0.001
   texture {WhateverTextureYouWant}
}

In case you are interested, the helical function is controlled like this:
- (sin(atan2(x, z)*NumberOfRidges + y*AmountOfTwist)*RidgeDepth)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Fontaine
Subject: Re: Isosurface math questions
Date: 16 Dec 1999 19:26:32
Message: <385981B6.2B077A4C@isd.net>
> With the + and - operators. :-)
> If you have two functions that are #defined, say MyFuncA and MyFuncB, do
> something like
> function {MyFuncA(x, y, z) + MyFuncB(x, y, z)}

If I have three torus functions, on the x-y, x-z, and y-z planes, then a
point p might be 3 units from one circle and 1 unit from another and 6 units
from another and have a value of 10 and that doesn't do what I want it to,
combine functions like they were unioned or isoblobbed.

--
David   http://thunder.prohosting.com/~davidf  (ICQ 55354965)
"The paper holds their folded faces to the floor" -Pink Floyd


Post a reply to this message

From: Chris Huff
Subject: Re: Isosurface math questions
Date: 16 Dec 1999 19:55:58
Message: <chrishuff_99-87E76F.19563216121999@news.povray.org>
In article <385981B6.2B077A4C@isd.net>, lfo### [at] isdnet wrote:

> > With the + and - operators. :-)
> > If you have two functions that are #defined, say MyFuncA and MyFuncB, 
> > do
> > something like
> > function {MyFuncA(x, y, z) + MyFuncB(x, y, z)}
> 
> If I have three torus functions, on the x-y, x-z, and y-z planes, then a
> point p might be 3 units from one circle and 1 unit from another and 6 
> units
> from another and have a value of 10 and that doesn't do what I want it 
> to,
> combine functions like they were unioned or isoblobbed.

To union functions, use the boolean OR operator(|) between the functions.
To make them blob together, you have to make them into density 
functions, try using min and max to clamp the values into a specific 
range. Here is a useful function for doing this:

#declare clamp = function {min(y, max(x, z))}
clamp(value, minimum, maximum)
Clamps the value to the range [minimum, maximum]. Can only be used in 
isosurface functions and function pigments.

But really, this is what the isoblob object was designed for, why not 
use it? It is included in MegaPOV.

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Fontaine
Subject: Re: Isosurface math questions
Date: 16 Dec 1999 23:31:01
Message: <3859BAFD.4E15D2E8@isd.net>
> To union functions, use the boolean OR operator(|) between the functions.
> To make them blob together, you have to make them into density
> functions, try using min and max to clamp the values into a specific
> range. Here is a useful function for doing this:
>
> #declare clamp = function {min(y, max(x, z))}
> clamp(value, minimum, maximum)
> Clamps the value to the range [minimum, maximum]. Can only be used in
> isosurface functions and function pigments.

Thanks for the info.

> But really, this is what the isoblob object was designed for, why not
> use it? It is included in MegaPOV.

Because I like to experiment with the math, I find it interesting. I learn ten
times more on my own than I ever do in school.

--
David   http://thunder.prohosting.com/~davidf  (ICQ 55354965)
"The paper holds their folded faces to the floor" -Pink Floyd


Post a reply to this message

From: Chris Huff
Subject: Re: Isosurface math questions
Date: 17 Dec 1999 06:56:11
Message: <chrishuff_99-8CBA3B.06564517121999@news.povray.org>
In article <3859BAFD.4E15D2E8@isd.net>, lfo### [at] isdnet wrote:

> Because I like to experiment with the math, I find it interesting. I 
> learn ten times more on my own than I ever do in school.

I know what you mean, especially with all the time school wastes 
"teaching" stuff they already taught you or which you learned in other 
places. And their assumption that whatever you learned on your own is 
worthless.
Oh well, I am done ranting now. :-)

-- 
Chris Huff
e-mail: chr### [at] yahoocom
Web page: http://chrishuff.dhs.org/


Post a reply to this message

From: David Fontaine
Subject: Re: Isosurface math questions
Date: 17 Dec 1999 17:11:29
Message: <385AB390.71D8DAB2@isd.net>
> Oh well, I am done ranting now. :-)

I'm never done ranting!
I think school wouldn't be *that* bad if they didn't always hold people
back. Math is finally moving at a decent pace now, I'm getting my first
new material in 3 years. If the counselors did more than pick their butts
all day I could have had this new material 3 years ago. Everything goes
down the toilet in middle school.
Actually, I heard once that the USA has some of the best elementary
schools, but some of the worst high schools. My theory is that middle
school f*cks it all up and the high schools can't get students back on
track fast enough.

--
David   http://thunder.prohosting.com/~davidf  (ICQ 55354965)
"The paper holds their folded faces to the floor" -Pink Floyd


Post a reply to this message

From: Bjoern Jaeger
Subject: Re: Isosurface math questions
Date: 22 Dec 1999 19:09:55
Message: <38616853@news.povray.org>
Hi

>If I have three torus functions, on the x-y, x-z, and y-z planes, then a
>point p might be 3 units from one circle and 1 unit from another and 6
units
>from another and have a value of 10 and that doesn't do what I want it to,
>combine functions like they were unioned or isoblobbed.
To blob them together you could try this:
Sum up for all your functions f : 1/f(x,y,z)
To bound the values and gradients you might have to use min
(sum,someconstant). Also you will have to negate the sign-value and adjust
the threshold-value.

Well, I hope that was what I've tried lately. Can't look it up now, sorry.

Have fun

                   Bjoern


Post a reply to this message

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