Surface Reconstruction with Marching Cubes and Truncated Signed Distance Function
Introduction:
Different from the extrusion-based method, the spray-based printing method for concrete usually requires a surface refinement step after printing is finished due to the nature of the spraying method. Thus, surface information for the printed shape became important for an accurate final shape if using robotics plastering approach. With the sensor point cloud input, I was thinking a marching cubes/tetrahedra method with dynamic Truncated Signed Distance Function volume and a height-map-based method could be an ideal method of surface reconstruction.
Method:
I updated the TSDF volume with the input points from the point cloud with the camera position, voxel center, and point coordinates. The TSDF is measuring the weighted distance between the voxel center and the surface. Using this, we can interpolate the vertices between adjacent voxels around the zero-crossings and iso values that leads to the triangles in the surface mesh. With the triangles we can visualize the mesh using OpenGL library with customized lighting.
The main difficulty of the algorithm is to make the existing one compatible with our data structure that doesn't have a structured 3D grid for searching. This brings an issue with unordered iteration over the voxels and causes problems when only accessing the adjacent voxels along a fixed direction. For each voxel, we need to access 8 different directions to reconstruct the surfaces from the complete surface. However, there's a possibility of duplicated triangles on the surface slowing down the rendering as well as the computation process. I implemented a mesh structure that has a hash table for the triangles which ensures all the triangles in the mesh are unique.
The height-based method is more suitable for cases where concrete is printed on a planer test bed. This method uses a 2D grid that contains the mean height for points and connects the average heights to form the surface.
Result:
I reconstructed the surfaces with this method and some test cases are shown above:
The height-map-based method gives a result of concrete surface reconstruction like the following :
Conclusion:
However, we have to give up this approach for surface reconstruction due to the artifact of the algorithm with a thin structure. The iterated 3D model in the simulator does not guarantee a smooth update of TSDF volume between frames, leading to incorrect TSDF volume that does not make continuous surfaces. Though it was an unsuitable method for this specific case, I learned a lot during the implementation of the algorithm.
I adapted the height-map-based surface reconstruction method in the end for better accuracy.