Slice pipes

How can one slice & cap pipe ends at 45 degrees?
This example was made 11 years ago using rhinoscript.
Now I would like to do it with Grasshopper.
Any leads?

If the pipe was based on a curve, place a Frame (Plane) at the end of the curve, rotate it nn degeres, Cut & Cap :

(I cheated with the distance from the curve ends (red dot). That distance better be calculated depending on the angle and pipe radius):

Split And Cap Pipe (15.6 KB)

// Rolf

Thanks a lot, I will try to reverse engineer it, I am toitaly new to grasshopper.