Matlab algorithm to reconstructs the geometry of various sets of pipes