How to calculate the cut length of pipes in a drawing