Rank: 28850 based on 0 downloads (last 30 days) and 0 files submitted
photo

Edward Bender

E-mail
Company/University
The University of Wisconsin-Madison

Personal Profile:
Professional Interests:
2D and 3D image processing, registration

 

Watch this Author's files

 

Comments and Ratings by Edward View all
Updated File Comments Rating
30 Apr 2009 triangulationVolume Compute volume and area of triangulation using divergence theorem of Gauss Author: Jeroen Verbunt

I think I found a way to fix the code. On the line where Gauss' law is used:

vol = vol + abs(P(1) * N(1) * a);

The absolute value there is not correct and should be removed - when the vector field and normal vector are antiparallel the addition to the volume needs to be negative. With the current implementation you can change the volume by shifting the X coordinate. If you get rid of the absolute value everything is fine, so long as you can ensure that the normals on the surface point OUT. Although the addition of the absolute value seems intuitive, it is not how Gauss's law works.

The normals can be computed with another code on the filie exchange: computeNormalVectorTriangulation by David Gingras. David's code will give you normals that point outwards so long as the triangles are defined in a certain way... Refer to his code.

This update seems to give the right volume and remove the dependence on translation of vertices, at least in my testing.
 
-Ed

30 Apr 2009 Compute normal vectors of 2.5D triangulation That function compute the normal vectors of a 2.5D triangulation. Author: David Gingras

Worked perfectly the first time. A+!

24 Apr 2009 Triangular Mesh Refinement This function will refine a triangular mesh with 4-split spline interpolation Author: Dirk-Jan Kroon

This is an excellent file that does exactly what it says it does. It worked the first time. I don't know why someone else gave it a bad rating - I think it's perfect as is.

Contact us at files@mathworks.com