[vtkusers] Reference for VTK volume calculation from triangular mesh

Upal, Anwar AUpal at Lifespan.org
Wed May 21 14:51:51 EDT 2003


May peace and blessings of God be on you all,
Dear VTK users,

I pray that you are happy and well.  
I am using the VTK 4.0 to find the volume of a triangular 3D mesh.  I am
using the GetVolume method in vtkMassProperties. As I was going through the
method to understand the mathematics behind the volume calculation, I came
accross the use of the Discrete Divergence theorem for a correction to the
volume.  It seems that this correction is based on the orientation of the
triangles in the mesh.  I have searched the net and my calculus texts and
found the Divergence Theorem but I still do not understand the application
of it in this case. Can someone either explain this volume calculation to me
in easy to understand language or point me to a detailed reference.

  // Weighting factors in Discrete Divergence theorem for volume
calculation...
  //      
  kxyz[0] = (munc[0] + (wxyz/3.0) + ((wxy+wxz)/2.0)) /(double)(numCells);
  kxyz[1] = (munc[1] + (wxyz/3.0) + ((wxy+wyz)/2.0)) /(double)(numCells);
  kxyz[2] = (munc[2] + (wxyz/3.0) + ((wxz+wyz)/2.0)) /(double)(numCells);
  this->VolumeX = vol[0];
  this->VolumeY = vol[1];
  this->VolumeZ = vol[2];
  this->Kx = kxyz[0];
  this->Ky = kxyz[1];
  this->Kz = kxyz[2];
  this->Volume =  (kxyz[0] * vol[0] + kxyz[1] * vol[1] + kxyz[2]  * vol[2]);
  this->Volume =  fabs(this->Volume);

I thank you for taking the time to help me.

Best regards,
Anwar Upal

____________________________________________
Anwar Mohammad Upal
Orthopedics Research Engineer,
Department of Orthopedics,
Brown Medical School/Rhode Island Hospital, 
Providence, RI, 02903.
Ph: 401-444-2987    Fax: 401-444-4418
____________________________________________ 



More information about the vtkusers mailing list