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:

enter image description here

that not result want get. how make boost return blue polygon minus red one? this:

enter image description here

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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -