
HxH wrote:
Thank you so much ! It helps me a lot. However, if I do an AND operation with two polygons that don't overlap each other, I will get segmentation fault. Originally I thought it would return all 0 to represent the empty set. I am trying to use the contains function to fix this problem but it seems like I have to get the points back from one of the polygon. Do you have any better suggestions?
Thank you for your helps !!
pts.insert(pts.begin(),group_2[0].begin(),group[0].end());
If the result of the AND is empty the output vector of polygons is left empty. You are indexing into the empty vector group_2, which causes the segmentation fault.
pts.insert(pts.begin(),group_2[0].begin(),group[0].end());
I believe it will be faster for you to debug such problems yourself rather than ask the list. Regards, Luke