I create a mesh by using 'open3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape' function and wanted to calculate the volume of it. But a RuntimeError occurs as the following shows:
[Open3D WARNING] [CreateFromPointCloudAlphaShape] invalid tetra in TetraMesh
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [27], in <cell line: 7>()
3 point_cloud.points = open3d.utility.Vector3dVector(data_all)
5 tri_mesh = open3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape(point_cloud, alpha=10)
----> 7 v = open3d.geometry.TriangleMesh.get_volume(tri_mesh)
8 print(v)
RuntimeError: [Open3D Error] (double open3d::geometry::TriangleMesh::GetVolume() const) /Users/runner/work/Open3D/Open3D/cpp/open3d/geometry/TriangleMesh.cpp:1220: The mesh is not watertight, and the volume cannot be computed.
I searched online (https://github.com/isl-org/Open3D/pull/3201) and found that the warning message (invalid tetra in TetraMesh) is a common problem and the reason is that some points are inside the mesh and not in the surface. Therefore, I exclude all the points that are not in the surface by calculating each point's distance to the surface.
Then, I recreate the mesh by using 'open3d.geometry.TriangleMesh.create_from_point_cloud_alpha_shape' function. The same issue occurs and the mesh is still not watertight.
Is there any method to solve this problem and calculate the volume?
Thanks!