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:15:16 EDT (-0400)
  Re: Problem with f_rounded_box function  
From: Christoph Hormann
Date: 9 Mar 2006 11:55:03
Message: <dupme5$rqb$1@chho.imagico.de>
Sebastian H. wrote:
> Sebastian H. wrote:
> 
>> problem/bug?
> 

The docs are wrong, f_rounded_box() should only be used with radius > 0. 
  This is not a bug but simply a limitation (although it would of course 
make sense to add an efficient handling of the case radius=0).

Note the current f_rounded_box() is not a very efficient solution anyway 
(you don't need an sqrt() for every evaluation).

> I dug a bit in the source code and found that a
> change in fnintern.cpp fixes the problem.
> In the f_rounded_box function there is an offset
> of 1e-6 subtracted from the actual result.
> 
> return (... - 1e-6);
> 
> With an increased offset magnitude of 1e-3
> the problem disappears and the isosurface looks correct.
> Why this offset is there is beyond me but removing it
> slows down the isosurface rendering a lot.

To me it seems this offset is specifically for handling the degenerate 
case.  Choosing 1e-3 simply gets you beyond your accuracy limit.

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/


Post a reply to this message

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