Select anywhere that there is a crossing of the rectangle and do a Boolean Subtraction:
resulting in:
repeat for each crossing element:
resulting in:
repeating this:
one eventually arrives at:
Select anywhere that there is a crossing of the rectangle and do a Boolean Subtraction:
resulting in:
repeat for each crossing element:
resulting in:
repeating this:
one eventually arrives at: