Connecting pipes

87 Views Asked by At

Suppose we have three pipes in 3D and one end of a pipe mark as inlet and other end marks as outlet. We have to connect outlet edge with other pipe inlet edge.

Here is the visual representation of pipes:

Image

In the above image, a green node is inlet and a yellow node is outlet.

Can anybody suggest me an algorithm that connect pipes as mentioned in a image?