Trim and join solids

Hello,
After creating some pipes, i want to split them one with the other to avoid overlaps, and than to join them
and get the total surface.
im adding my gh and 3dm.
any idea?
st.3dm (2.9 MB)
ST.gh (13.3 KB)