POV-Ray : Newsgroups : povray.binaries.images : Problem with f_rounded_box function : Re: Problem with f_rounded_box function Server Time
17 May 2024 05:14:48 EDT (-0400)
  Re: Problem with f_rounded_box function  
From: Sebastian H 
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


Post a reply to this message

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