c++ - boost polygon difference returns intersection -
i trying substract 1 polygon boost::geometry::difference.
first of create 2 polygons, lets call them red , blue. know polygons created correctly because y plotted them.
now, if compute difference between polygons so:
boost::geometry::difference( blue, red,green);
where green should result of substraction.
i points green green.outer() (i know green containter, given know 1 polygon result wanted simplify example) , plot them.
this result get:
that not result want get. how make boost return blue polygon minus red one? this:
edit: tried computing intersection between polygons , want. thats odd. don't know if doing wrong or boost people don't know math.
i had similar issue. found of difference operations worked while others did not.
in case, due incorrect vertex winding adam suggested in comments. fixed using boost::geometry::correct().
Comments
Post a Comment