i am trying to substract one polygon from another with boost::geometry::difference.
First of all i create 2 polygons, lets call them red and blue. I know the polygons are created correctly because y plotted them.
Now, if i compute the difference between those polygons like so:
boost::geometry::difference( blue, red,green);
Where green should be the result of the substraction.
I then get the points from green with green.outer() (i know that green is actually a containter, but given that i know that i will only get one polygon as a result i wanted to simplify my example) and plot them.
This is the result i get:
That is not the result i want to get. How could i make boost return the blue polygon minus the red one? like this:
EDIT: I tried computing the intersection between those polygons and i get what i want. Thats odd. don't know if i am doing something wrong or boost people don't know math.
green_container
instead ofgreen
asvector<polygon>
and after that you makepolygon green = green_container[0];
– Luka Rahnerist
* should have beenfirst
in my previous comment) – sehe