I have an unorganized point cloud with a bunch of 3d points. I use a certain surface reconstruction method to obtain a triangle mesh of the underlying surface. The surface could be closed or not. Can somebody point me out to how I would go about estimating the volume enclosed by such a surface (if its closed). If its not closed, then what would a way to "close" it and get a volume? I would appreciate if somebody could even point out C++ libraries that would help me do this.
This site has both code and theoretical descriptions. Look for items that mention "polyhedral mass properties". They typically live in the "physics" sections of the site.
"Closing" the volume can be done by adding missing surfaces. Project your entire mesh onto the XY plane, assigning the value +1 if the normal of a triangle points away from the XY plane and -1 if it points to the XY plane. If the volume is closed, each part of the projection is covered by an even number of triangles from the mesh; half with value +1 and half with value -1.
If there's a simple single hole in the triangle mesh, there will be a simple single hole in the projection as well. Just trace the edges back. If there are multiple holes, there's generally no unique solution. (You could patch both holes or connect them by a tube).
Since there might be triangles missing orthogonal to the XY plane, you also need to repeat this for the XZ and YZ planes.