POV-Ray : Newsgroups : povray.advanced-users : volume calculations : Re: volume calculations Server Time
6 Oct 2024 16:14:48 EDT (-0400)
  Re: volume calculations  
From: Tim Attwood
Date: 11 Jan 2007 05:57:20
Message: <45a61810$1@news.povray.org>
>  If you want any accuracy at all, it would take a very LONG time.
>
>  I would estimate that getting one additional decimal of accuracy
> (or whichever base is used) requires O(n^3) more points to be sampled.
> You can figure out that that number grows quite fast.

I ran a test on a half sphere that came out in 13 seconds
with an accuracy of about 0.3%
The half sphere should be 2/3 pi r cubed volume, 2.094
since I used a r of 1, and the estimate was 2.087

I ran a second test with the half sphere scaled up by 100
and got the same sort of result 13 seconds and 2087920,
so the adaptive loop in my volume estimate algorithm isn't
sensitive to object size.

I did a third test with a narrow cylinder (rotated so that the
bounding was larger), it was off by about 1.3% in 11 seconds.

If I remember my statistics right, it only takes a fixed number
of samples to accurately represent a larger population to
some confidence level, which is why you see the plus or minus
4% on a lot of news polls. So it should run about O(n) time, though
that time increases O(n^3) as you modify the algorithm to be more
accurate.

I could see that a narrow enough object might return
zero volume if the real volume is only a few percent of the
bounding box.


Post a reply to this message

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