Now I use the CGAL::Construct_project_point_2 function to recalculate the point if the point is close to the segment enough, before
every difference operation, then I get my expecting resultant polygon.
But I have a question about the CGAL::Construct_project_point_2.
If my understanding is right, does the function returns me a collinear point according to a point and a segment?
Glad to know it worked. The type conversion of the Point_2 type and its
usability mainly depends on how your program works. Make sure to avoid any
type of downcasting. There are various solution available for that. I could
have given a further detailed solution, if i had a look at your program.
Moreover i think you can figure it out yourself. If still you need any
assistance, i would be glad to help.