Boost logo

Geometry :

Subject: [ggl] Error with triangle cutting
From: Christoph Keller (christoph)
Date: 2011-08-19 11:39:52


I wanted to calculate the difference of two triangles: lP-vecs.

The result i get with "difference is" wrong. There are points in the
result, that are not nearly in Lp. I assume this is because one edge of
Lp is nearly a subset of an edge of vecs.

Are these corner cases supposed to work in boost::geometry, or should i
treat them before i call difference?

I use double precision and closed clockwise polygons with then 4
vertices/polygon for both polygons. I use the latest boost version. I am
pretty sure I made no mistake calling the intersection function.


     vecs[0] = DVec(0.24806946917841693 ,26.015444246572663);
     vecs[1] = DVec(31.751930530821582 ,33.984555753427337);
     vecs[2] = DVec(32.248069469178418 ,30.015444246572663);

     lP[0] = DVec(17.763942722600319, 32.236057277399681);
     lP[1] = DVec(19.192448808558737, 30.807551191441263);
     lP[2] = DVec(16.000000000000000, 30.000000000000000);

Geometry list run by mateusz at