|
![](/i/fill.gif) |
Warp wrote:
> The measurement of volume depends on your definition of volume.
My measurement goes off of eval_pigment and the object pattern in MegaPov. I
leave the metaphysics up to those functions.
> If so, how do you calculate the volume of this kind of object:
> difference { box { -1,1 } sphere { 0, 1.1 }}
That's 2.609 cubic units, to a 0.25% precision. See my macro. I keep taking
smaller and smaller intervals until the difference between two sucessive
values for volume is less than a certain percentage.
> (and suppose the same situation with more complex objects than a box and a
> sphere, eg. a lathe and an isosurface.)
I tried this isosurface and got a volume of 288737 cubic units.
isosurface{
function{y/290+noise3d(x*0.05,y**0.05,z**0.05)}
accuracy 0.01
threshold .21
contained_by {sphere{0,100}}
pigment{SeaGreen}
finish{ambient 0.1}
}
As I was tossing in my sleep last night, however, I realized that my macro can
easily handle any of the above discussed objects, but it's not very good for
its original purpose: determining *whether* the intersection between two
objects has zero volume. It's not that great if say I have one object with a
huge bounding box-- say a landscape-- and a bunch of tiny things. But I guess
if one had enough patience or set a low bailout, it would work here OK too.
Post a reply to this message
|
![](/i/fill.gif) |