Boost logo

Boost Users :

Subject: Re: [Boost-users] logic operation in boost polygon
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2011-05-12 13:01:10


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net