## algorythm for calculating a volume

### algorythm for calculating a volume

We need to calculate the volume of a box defined by n point where all the
coordinates  (Xi, Yi, Zi) of all the surfaces are known.
the technic of calculating the volume of a polyhedron with the signed
volume of the tetrahedron  (FAQ 5.1.9) shouldn't work on convex surfaces.
So we would like to find an other algorythm (like the verification of tthe
belonging of a moving cube to this volume ...)

--
P. Luquet
Bien entendu

### algorythm for calculating a volume

>We need to calculate the volume of a box defined by n point where all the
>coordinates  (Xi, Yi, Zi) of all the surfaces are known.
>the technic of calculating the volume of a polyhedron with the signed
>volume of the tetrahedron  (FAQ 5.1.9) shouldn't work on convex surfaces.
>So we would like to find an other algorythm (like the verification of tthe
>belonging of a moving cube to this volume ...)

If your surface is closed and if you can also compute (outer) unit normal
vectors at each of the sample points, then the code
http://www.cs.unc.edu/~eberly/misc.htm , file meas3d.cpp computes
approximations to the surface area and volume for such data sets.  If
your samples (Xi,Yi,Zi) were obtained by thresholding from a 3D image,
then normals can be computed from that image by estimating the
gradient at the sample by using central finite differences for each of
the three partial derivatives.

The algorithm uses the Divergence Theorem from calculus.  It also
does not require computing a polygonal mesh and does not require
any sorting.  You simply feed it the list of surface points and normal
vectors.

Dave Eberly

### algorythm for calculating a volume

>The algorithm uses the Divergence Theorem from calculus.  It also
>does not require computing a polygonal mesh and does not require
>any sorting.  You simply feed it the list of surface points and normal
>vectors.

Hmm... integral over the surface of a vector field dotted with the surface
normal (normalised, times area for a plane) is equal to the integral over the
enclosed volume of the divergence of the vector field. So you just need the
vector field to have a divergence of 1 in all space (like [x,o,o]) to use your
volume-calculating method? That's pretty cunning, I like it.

--
Iestyn

_______    ___     __     __  __     ______ _____
/ _____/\  /   |   / /\   / /\/ /\   / ____// __  \
/ /\____\/ / /| |  / / /  / / / / /  / ___/\/ /\_/ /\
\ \__/ /\ / / | | / /_/_ / / / /_/_ / /___\/ /_// / /
\____/ //_/ /|_|/_____//_/ /_____//______/\_____/ /
\___\/ \_\/ |_|\_____\\_\/\_____\\______\/\____\/

WWW   : http://www.galileo.base.org
news  : alt.games.galileo

Hello there,

being new in the field, I wonder if someone could tell me how to
calculate quickly 3D volumes defined from arbitrary geometrical
shapes and 3D volumes defined from cubes or tetrahedron's intersection.

Any help appreciated

Olivier