Add levels to debug.
Use isPointInside2 instead of isPointInside. This second method may be less efficient since it uses trigonometry, nonetheless, it works everywhere, whereas the first one won't work when trying to cut along line whose equation is y = -x. It was a matter of the infinite point located on this very line and even if I choose a random infinite point, the line won't be valid as soon as the line formed with the first (or the second) point and the infinite point is equal to the line that bears the cutting segment.