This is a follow-up question to How to test if a line intersects a convex polygon?
Lets say I am able to test if a line intersects a convex polygon or not (I'm still not sure what's the best method, and this question is linked with my difficulty). What I want to do is this: If I find that the line intersects the polygon, I want to maintain either the left or right polygon that is created. I'm not sure how to maintain the polygon object so that the above is easy to compute.
To summarize, given a polygon object and a line, how do I find the new polygon that is created by intersecting the halfplane-created-by-the-line with the polygon? Does CGAL or any other library have a ready-to-use function for this? If I have to code this from scratch, how should I maintain the polygon object?