There are 4 rules explained in Sutherland-Hodgman algorithm for clipping polygons:
- If both vertices are inside the clipping area - save the second
- If the first vertex is inside and the second is outside - compute the intersection with the border of the clipping area and save it
- If the first vertex is outside and the second is inside - compute the intersection with the border of the clipping area and save it, and also save the second vertex
- If both vertices are outside - save nothing
Due to this explanation, what will it do when a line formed by 2 vertices crosses the clipping area, like in the below image?
If I follow the algorithm steps I'll end up with no vertices at all... Is there no consideration for such a case? Maybe I should pre-calculate all the intersection areas and use also them?
