I can imagine. Maybe sort all the pipes (or their endpoints) by location. Then for every point in the sorted list check if the next points are within a certain margin (meaning they must belong together) and then connect those. Of course this can be really error prone if you can’t get the margin right.