POV-Ray : Newsgroups : povray.advanced-users : volume calculations : Re: volume calculations Server Time
6 Oct 2024 14:40:18 EDT (-0400)
  Re: volume calculations  
From: Rune
Date: 10 Jan 2007 12:22:01
Message: <45a520b9$1@news.povray.org>
Warp wrote:
> Tim Attwood <tim### [at] comcastnet> wrote:
>> Using extents of an object you can calculate the
>> volume of the bounding box, then use a large number of
>> random point samples within the bounding box to determine
>> the percent of samples that are inside the object, then
>> the volume can be estimated to be that percent of the
>> bounding volume.
>
>  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.

For objects that fill a reasonably high percentage of the bounding box (such 
as a sphere) it wouldn't be a big problem unless you really care about high 
accuracy. For other objects though, such as, say, a cylinder from <-1,-1,-1> 
to <1,1,1> with radius 0.01, testing all points (with some proximity) within 
the bounding box is extremely inefficient. However, pre-testing with trace 
lines within the bounding box parallel with one or more axes could be used 
to weed out by far the most points beforehand, and this would only be 
O(n^2).

Rune
-- 
http://runevision.com


Post a reply to this message

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