<HTML>
Erik Sobel wrote:
<BLOCKQUOTE TYPE=CITE>Does anyone have an example of how to measure the
volume produced by the
<BR>intersection (overlap) of two volumes?
<P>Thanks,
<BR>Erik
<BR>----------------------------------------------------------------------------------------------------------
<BR>Erik Sobel
<BR>esobel@alphatech.com
<BR>----------------------------------------------------------------------------------------------------------
<P>_______________________________________________
<BR>This is the private VTK discussion list.
<BR>Please keep messages on-topic. Check the FAQ at: <<A HREF="http://public.kitware.com/cgi-bin/vtkfaq">http://public.kitware.com/cgi-bin/vtkfaq</A>>
<BR>Follow this link to subscribe/unsubscribe:
<BR><A HREF="http://public.kitware.com/mailman/listinfo/vtkusers">http://public.kitware.com/mailman/listinfo/vtkusers</A></BLOCKQUOTE>
I assume that you have only a polygonal surface to define the volumes.
<P>1) If both volumes are convex you can actually calculate the surface
defining
<BR> the intersection using vtkHull (I think it's
vtkHull). vtkMassProperties
<BR> will calculate the volume for you.
<P>2) For non-convex (or convex) volumes, the best approach to calculating
the
<BR> volume of the intersection is to calculate the polygonal
boundaries of the
<BR> intersections of the volumes with a set of planes
and use the areas of the
<BR> polygons to integrate in 3D.
<BR>
<BR> The intersection of the polygons in a plane is equivalent
to the scan-conversion
<BR> algorithm for rendering polygons. (The
is some code in Graphics Gems
<BR> which does this.) A really cool way to do
it would be to draw the polygons
<BR> into an offscreen buffer using transparency
using certain colors for the
<BR> polygonal interiors. The numbers of
pixels with the appropriate blended color
<BR> measures the area of the intersection.
<P> You don't really need to integrate. Just
count the pixels in one of the
<BR> volumes and in the intesection in a
series of planes. The ratio of these
<BR> pixel counts is a number < 1 which
can the multiplied by the original
<BR> volume to get the intersection volume.
<P> I yield to other people with another
approach which is plausible.
<BR> I have dealt with related problems and
don't know of a better way
<BR> to do this.
<P>Dav
<P>
<PRE>--
David E Jones
Du Pont Central Research
Experimental Station, Bldg 320
Wilmington, DE 19880-0320</PRE>
</HTML>