POV-Ray : Newsgroups : povray.unofficial.patches : Question about isosurface functions Server Time
2 Sep 2024 14:13:16 EDT (-0400)
  Question about isosurface functions (Message 1 to 10 of 12)  
Goto Latest 10 Messages Next 2 Messages >>>
From: Nieminen Juha
Subject: Question about isosurface functions
Date: 4 Jan 2000 12:07:58
Message: <387228ee@news.povray.org>
If this gives me a sphere:

isosurface { function { x^2+y^2+z^2-1 } }

why this doesn't:

#declare f1 = function { x }
#declare f2 = function { y }
#declare f3 = function { z }
isosurface { function { f1^2+f2^2+f3^2-1 } }

?

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 12:29:32
Message: <chrishuff_99-6D76A9.12293704012000@news.povray.org>
In article <387228ee@news.povray.org>, Nieminen Juha 
<war### [at] punarastascstutfi> wrote:

>   If this gives me a sphere:
> 
> isosurface { function { x^2+y^2+z^2-1 } }
> 
> why this doesn't:
> 
> #declare f1 = function { x }
> #declare f2 = function { y }
> #declare f3 = function { z }
> isosurface { function { f1^2+f2^2+f3^2-1 } }
> 
> ?

I think there might be a bug with the isosurface functions when the 
parameters are not specified. I think it should use (x, y, z) by 
default, but this crashed MacMegaPOV when I tried it. Try using:
isosurface {
    function {
        f1(x, y, z)^2+
        f2(x, y, z)^2+
        f3(x, y, z)^2-1
    }
}
instead.

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


Post a reply to this message

From: Nieminen Juha
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 12:37:44
Message: <38722fe8@news.povray.org>
Chris Huff <chr### [at] yahoocom> wrote:
: I think there might be a bug with the isosurface functions when the 
: parameters are not specified. I think it should use (x, y, z) by 
: default, but this crashed MacMegaPOV when I tried it. Try using:
: isosurface {
:     function {
:         f1(x, y, z)^2+
:         f2(x, y, z)^2+
:         f3(x, y, z)^2-1
:     }
: }
: instead.

  It didn't help.

-- 
main(i,_){for(_?--i,main(i+2,"FhhQHFIJD|FQTITFN]zRFHhhTBFHhhTBFysdB"[i]
):5;i&&_>1;printf("%s",_-70?_&1?"[]":" ":(_=0,"\n")),_/=2);} /*- Warp -*/


Post a reply to this message

From: Chris Huff
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 13:20:15
Message: <chrishuff_99-6C6FA0.13202004012000@news.povray.org>
In article <38722fe8@news.povray.org>, Nieminen Juha 
<war### [at] punarastascstutfi> wrote:

>   It didn't help.

Hmm, I don't know what's wrong. I tried a few things for myself, and 
while it crashes when noise3d is used with no parameters, those 
functions render with no trouble...but with no result. Also, these 
doesn't work:
#declare f4 = function {x^2+y^2+z^2}
isosurface {function {f4(x, y, z)-1}}

#declare f4 = function {sqrt(x^2+y^2+z^2)}
isosurface {function {f4(x, y, z)^2-1}}

but these do:
#declare f4 = function {x^2+y^2+z^2}
isosurface {function {sqrt(f4(x, y, z))-1}}

#declare f4 = function {sqrt(x^2+y^2+z^2)}
isosurface {function {f4(x, y, z)-1}}

However, if you force method 1 solving, everything seems to work fine. 
Just add the line "method 1" to the isosurface. Of course, this slows 
things down.
Specifying a larger max_gradient(I tried 5) seems to work too. I would 
guess maybe it is having trouble calculating the gradient of those 
declared functions.

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


Post a reply to this message

From: Kevin Wampler
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 13:33:02
Message: <38723C50.47FAFFCE@tapestry.tucson.az.us>
I'm afraid that I can't help you with you question, but I have another
similar question:

Why does y-exp(-(x^2)-(z^2)) render the same as y-exp(-(x^2)-z^2) but
differently from y-exp(-x^2-(z^2)) and y-exp(-x^2-z^2)?


Post a reply to this message

From: omniVERSE
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 14:26:23
Message: <3872495f@news.povray.org>
Order of math, the non-parenthesis parts will go last.

Bob

"Kevin Wampler" <kev### [at] tapestrytucsonazus> wrote in message
news:38723C50.47FAFFCE@tapestry.tucson.az.us...
> I'm afraid that I can't help you with you question, but I have another
> similar question:
>
> Why does y-exp(-(x^2)-(z^2)) render the same as y-exp(-(x^2)-z^2) but
> differently from y-exp(-x^2-(z^2)) and y-exp(-x^2-z^2)?
>
>


Post a reply to this message

From: Ron Parker
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 15:07:02
Message: <387252e6@news.povray.org>
On Tue, 04 Jan 2000 11:30:40 -0700, Kevin Wampler wrote:
>I'm afraid that I can't help you with you question, but I have another
>similar question:
>
>Why does y-exp(-(x^2)-(z^2)) render the same as y-exp(-(x^2)-z^2) but
>differently from y-exp(-x^2-(z^2)) and y-exp(-x^2-z^2)?

Without looking at the code, it looks like it's using too high a priority 
for unary minus, so it's treating "-x^2" as "(-x)^2".  BTW, I suspect you'd
get better performance with the sqr() function.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Kevin Wampler
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 15:19:18
Message: <38725525.57F20A09@tapestry.tucson.az.us>
That's what I thought, but upon closer examination, it appears to only assign
the unary minus a higher priority on the first term, so y-exp(-x^2-z^2)
renders differently from y-exp(-z^2-x^2).  Good point about the sqr()
function, I hadn't realized that it was optimized.

> Without looking at the code, it looks like it's using too high a priority
> for unary minus, so it's treating "-x^2" as "(-x)^2".  BTW, I suspect you'd
> get better performance with the sqr() function.


Post a reply to this message

From: Ron Parker
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 15:32:13
Message: <387258cd@news.povray.org>
On Tue, 04 Jan 2000 13:16:37 -0700, Kevin Wampler wrote:
>> Without looking at the code, it looks like it's using too high a priority
>> for unary minus, so it's treating "-x^2" as "(-x)^2".  BTW, I suspect you'd
>> get better performance with the sqr() function.
>
>That's what I thought, but upon closer examination, it appears to only assign
>the unary minus a higher priority on the first term, so y-exp(-x^2-z^2)
>renders differently from y-exp(-z^2-x^2).  Good point about the sqr()
>function, I hadn't realized that it was optimized.
>

The second term isn't a unary minus; it's the binary subtraction operator.

-- 
These are my opinions.  I do NOT speak for the POV-Team.
The superpatch: http://www2.fwi.com/~parkerr/superpatch/
My other stuff: http://www2.fwi.com/~parkerr/traces.html


Post a reply to this message

From: Kevin Wampler
Subject: Re: Question about isosurface functions
Date: 4 Jan 2000 15:40:32
Message: <38725A26.AABDB462@tapestry.tucson.az.us>
<voice = Homer> doh! </voice>


Post a reply to this message

Goto Latest 10 Messages Next 2 Messages >>>

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