you can use vtk library or here is simple c++ code: https://github.com/shykim/SurfaceConvert
best, Sun Hyung