From: Sebastian H
Subject: Re: Problem with f_rounded_box function
Date: 13 Mar 2006 05:55:38
Message: <44154faa$1@news.povray.org>
Christoph Hormann wrote:
> Yes, that's what i meant. I would however do it somewhat differently > (untested, based on what you wrote):
There's a problem with the PARAM_* used in the square roots.
Actually they are the distance from the "inner box" and must
be redefined as such before with the code you dropped.
(Abusing the parameters for this is a bit ugly, but...)
PARAM_X = x3 - x2;
PARAM_Y = y3 - y2;
PARAM_Z = z3 - z2;
The addition of the square roots with reduced argument number looks good
though I'm not sure whether by the third one anything is gained.
It's one additional comparison to maybe save one multiplication and
one addition.
> It would BTW be easy to add a correct distance function for the interior > as well by replacing the 'return -PARAM(0);'. This would of course > break backwards compatibility so it might not be a good idea.
It seems that the return -PARAM(0) also cures the max. gradient peaks.
Sebastian
From: Christoph Hormann
Subject: Re: Problem with f_rounded_box function
Date: 13 Mar 2006 07:15:03
Message: <dv3nib$8ku$1@chho.imagico.de>
Sebastian H. wrote:
> > There's a problem with the PARAM_* used in the square roots.> Actually they are the distance from the "inner box" and must> be redefined as such before with the code you dropped.> (Abusing the parameters for this is a bit ugly, but...)> > PARAM_X = x3 - x2;> PARAM_Y = y3 - y2;> PARAM_Z = z3 - z2;
As said - i did not yet test it.
> The addition of the square roots with reduced argument number looks good> though I'm not sure whether by the third one anything is gained.> It's one additional comparison to maybe save one multiplication and> one addition.
Well - the most important reason is to maintain the beauty of symmetry
in the code... ;-)
Christoph
--
POV-Ray tutorials, include files, Landscape of the week:
http://www.imagico.de/ (Last updated 31 Oct. 2005)
MegaPOV with mechanics simulation: http://megapov.inetart.net/
From: Sebastian H
Subject: Re: Problem with f_rounded_box function
Date: 15 Mar 2006 04:48:08
Message: <4417e2d8@news.povray.org>
Sebastian H. wrote:
> > Here's the image of the test scene I used for comparing> the speed of different incarnations of f_rounded_box.>
Here are the render times for the different versions
of f_rounded_box which are to find in p.programming.