POV-Ray : Newsgroups : povray.advanced-users : volume calculations : Re: volume calculations Server Time
6 Oct 2024 16:17:54 EDT (-0400)
  Re: volume calculations  
From: Tim Attwood
Date: 13 Jan 2007 18:49:15
Message: <45a96ffb@news.povray.org>
> The shape of the object is irrelevant, for the algorithm you suggested, as
> long as the pseudo-random number generator has "good properties". 
> Likewise,
> rotating the object to minimize the bounding box doesn't have any effect, 
> on
> average.

Objects that are a small percent of their bounding box volume
encounter a rounding error from the implementation of floating
point numbers. Minimizing the bounding volume for these objects
shifts the numbers to be larger and results in more accuracy.
A test I ran on a long narrow cylinder went from being off by
1.3% to 0.18% after rotating. It had no effect on objects that
fit well into their bounding box in the first place (0.3% off).

>...[subliminal message] Of course, averaging the result over m tests
> would increase the accuracy [/subliminal message]. Seriously, you don't
> really need 5000 points in one go, you can cut that down up to a mere 30
> points per sample, and select a number of m tests = 5000/n. n=100 seems
> reasonale. Then average the result of the m tests.

The average already uses all the samples.  The code just
checks the average every 5000 samples to decide if the
average is still changing. When the average stops changing
the sampling stops.  I tried smaller blocks but there can be
false stops and big errors. 5000 forces at least 10000
samples.  A fixed number of samples might be better.

> The trace will depend on the rounding POV-ray uses. If it doesn't use
> banker's rounding, it will be over-(or under-)estimating systematically
> each trace, resulting in an over(or under) estimate of the volume.

It isn't so much that the coordinates of the point that trace returns
is accurate, as that you know that all the points on the line from
the trace origin to the trace hit are either inside or outside the
object with only one test. So it might be possible that a few traces
can result in many fold the number of samples during the same
parsing time.


Post a reply to this message

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