Boost logo

Geometry :

Subject: [geometry] Reproducible bug ?
From: Romain Texier (romain.texier_at_[hidden])
Date: 2012-12-28 05:07:23


Hi,

I make the union of some triangles and an exception is thrown. The
exception is overlay_invalid_input_exception.
The triangles are provided by a mesh for a rendering tool. A mesh must
share some points.

Geometry()
{
BoostPolygons initial;
boost::geometry::read_wkt(
"MULTIPOLYGON(((0.166180 -0.534268, 0.165603 -0.534480,0.166038
-0.534463)))", initial);

BoostPolygons triangle; // share the 0.166038 -0.534463 point
boost::geometry::read_wkt(
"MULTIPOLYGON(((0.099057 -0.552843, 0.098486 -0.553060, 0.166038
-0.534463)))", triangle);
 BoostPolygons result;
boost::geometry::union_(initial, triangle, result);

boost::geometry::read_wkt(
"MULTIPOLYGON(((0.099057 -0.552843, 0.098339 -0.553041, 0.098486
-0.553060)))", triangle);
 BoostPolygons result2;
boost::geometry::union_(result, triangle, result2);

 boost::geometry::read_wkt(
"MULTIPOLYGON(((0.099057 -0.552843,0.166038 -0.534463,0.165603
-0.534480)))", triangle);
 BoostPolygons result3;
boost::geometry::union_(result2, triangle, result3);

// First-chance exception at 0x74c0c41f in BSPCreator.exe: Microsoft C++
exception: boost::geometry::detail::self_get_turn_points::self_ip_exception
at memory location 0x0044cb74..

}

My typedef are :
typedef boost::geometry::model::d2::point_xy<float> BoostPoint;
     // 2D float point
typedef boost::geometry::model::polygon<BoostPoint,false,false>
BoostPolygon; // Open and counter-clockwise polygon
typedef boost::geometry::model::multi_polygon< BoostPolygon > BoostPolygons;

Did I misunderstand something, or this is a bug ?

Regards,
Romain



Geometry list run by mateusz at loskot.net