Skip to content

Boost.Geometry intersection Bug: Returns Full Polygon Area for Two Non-Overlapping Polygons Summary #1439

@llpan91

Description

@llpan91

When computing the intersection of two non-overlapping simple polygons,
boost::geometry::intersection incorrectly returns a non-empty result, containing the full area of one polygon.

This is a critical topology error: a false-positive intersection.

Environment

Boost version: 1.79 / 1.81 / 1.82 (bug reproduced across versions)

Geometry models:

boost::geometry::model::d2::point_xy

boost::geometry::model::polygon

Compilers: GCC / Clang (bug reproduced consistently)

Operating System: Linux / Ubuntu 22.04

\ data

BgPolygon p1 = createPolygon({
    BgBgPoint(-2.47089026, -86.03059246),

    BgBgPoint(-1.161944873, 146.3030596),
    BgBgPoint(3.40221214, 145.8628015),
    BgBgPoint(3.024695769, 141.949088),
    BgBgPoint(2.420586453, 111.9554564),

    BgBgPoint(1.208013978, -86.04069936),
    BgBgPoint(-2.47089026, -86.03059246)
});



BgPolygon p2 = createPolygon({
    BgPoint(-6.213278056, -88.01851748),
    BgPoint(-6.207382255, -86.51852906),
    BgPoint(-6.20539951, -86.01408604),
    BgPoint(-2.470873099, -86.02434575),
    BgPoint(-2.472221358, -86.53315586),
    BgPoint(-2.476196085, -88.03315059),
    BgPoint(-6.213278056, -88.01851748)
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions