<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: &lt;<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>&nbsp;&nbsp;&nbsp;&nbsp; the intersection using vtkHull (I think it's
vtkHull).&nbsp; vtkMassProperties
<BR>&nbsp;&nbsp;&nbsp;&nbsp; will calculate the volume for you.

<P>2) For non-convex (or convex) volumes, the best approach to calculating
the
<BR>&nbsp;&nbsp;&nbsp; volume of the intersection is to calculate the polygonal
boundaries of the
<BR>&nbsp;&nbsp;&nbsp; intersections of the volumes with a set of planes
and use the areas of the
<BR>&nbsp;&nbsp;&nbsp;&nbsp; polygons to integrate in 3D.
<BR>&nbsp;
<BR>&nbsp;&nbsp;&nbsp; The intersection of the polygons in a plane is equivalent
to the scan-conversion
<BR>&nbsp;&nbsp;&nbsp;&nbsp; algorithm for rendering polygons.&nbsp; (The
is some code in Graphics Gems
<BR>&nbsp;&nbsp;&nbsp;&nbsp; which does this.) A really cool way to do
it would be to draw the polygons
<BR>&nbsp;&nbsp;&nbsp;&nbsp; into an offscreen buffer using transparency
using certain colors for the
<BR>&nbsp;&nbsp;&nbsp;&nbsp; polygonal interiors.&nbsp; The numbers of
pixels with the appropriate blended color
<BR>&nbsp;&nbsp;&nbsp;&nbsp; measures the area of the intersection.

<P>&nbsp;&nbsp;&nbsp;&nbsp; You don't really need to integrate.&nbsp; Just
count the pixels in one of the
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; volumes and in the intesection in a
series of planes.&nbsp; The ratio of these
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pixel counts is a number &lt; 1 which
can the multiplied by the original
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; volume to get the intersection volume.

<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I yield to other people with another
approach which is plausible.
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; I have dealt with related problems and
don't know of a better way
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; to do this.

<P>Dav

<P>&nbsp;
<PRE>--&nbsp;
David E Jones
Du Pont Central Research
Experimental Station, Bldg 320
Wilmington, DE 19880-0320</PRE>
&nbsp;</HTML>