Volume Enclosed by a Triangulated Surface

August 11, 2009 by Luigi Giaccari 
Filed under: CAD, Computational Geometry, Geometry 
4 Comments
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
VN:F [1.8.8_1072]
Rating: 10.0/10 (1 vote cast)

Surface Volume

Gets the Volume enclosed by the surface defined by p,t,tnorm. The surface must be closed and manifold, there is no check for this.
The algorithm compute the volume of 3 tetraedrons for each triangle. The normals orientation define the sign of volume, it is just a numerical integration.

Input:

  • p: nx3 array containing 3D set of points
  • t: triangles ids referring to p array. First point flagged as one.
  • tnorm: outwards triangles normals orientation

Output:

  • V: the Volume enclosed by the surface

For bugs,infos: giaccariluigi@msn.com

Download Now

VN:F [1.8.8_1072]
Rating: 10.0/10 (1 vote cast)
VN:F [1.8.8_1072]
Rating: 0 (from 0 votes)
Volume Enclosed by a Triangulated Surface10.0101

Popularity: 4% [?]

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Live
  • PDF
  • Technorati
  • Twitter
  • Yahoo! Bookmarks
  • Add to favorites
  • email
  • MySpace
  • RSS

Related Posts

Comments

4 Comments on Volume Enclosed by a Triangulated Surface

  1. Christopher Clark on Mon, 16th Aug 2010 16:10
  2. Hi,
    Thanks for your code this looks like exactly what i need.
    I do have one problem though. i have both the p and t matrices that i can use to draw my surface using trisurf but i do not have a tnorm matrix. Can you tell me any way to calculate this matrix is it is possible?
    thanks

    [Reply]

    UN:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.8_1072]
    Rating: 0 (from 0 votes)
  3. Luigi Giaccari on Tue, 17th Aug 2010 18:35
  4. You can compute the normals performing cross product on triangles edges.

    Be carefull that normals must points all outwards, otherwise there is no volume defined.

    Setting the normal orientation can be painfull, I suggest you to give a look at computational toolbox from the latest Matlab realeases. They have specific functions for this.

    [Reply]


    Christopher Clark Reply:

    Thank you.
    Do you have any idea of which methods could do this?
    When i use this function on some meshes it causes an error

    ??? Undefined function or method ‘CCTetra’ for input arguments of type ‘double’.
    Line 67

    i cannot find a method CCTetra
    on some meshes it never enters this while loop so never crashes.
    Can you tell me how to fix this?

    Thank you

    [Reply]

    UN:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UN:F [1.8.8_1072]
    Rating: 0 (from 0 votes)
  5. Luigi Giaccari on Wed, 18th Aug 2010 13:34
  6. That’s a bug,

    I forgot to change that after a function renaming.

    Just change “CCTetra” with “TetraVolume”. That’s the correct function name.

    It’s weird that nobody noticed it before!

    Since I don’t have time to test the scripti please give me feedback in case you have problems!

    The new corrected version is on the way to Matlab file exchange.

    [Reply]

    UA:F [1.8.8_1072]
    Rating: 0.0/5 (0 votes cast)
    UA:F [1.8.8_1072]
    Rating: 0 (from 0 votes)

Tell me what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!


Include MATLAB code in your comment by doing the following:

<pre lang="MATLAB">

%insert code here

</pre>