Skip to content

In Boost v1.87 boost::geometry::intersection can fail if the two polygons share some identical vertices #998

Open
@sbarkby

Description

@sbarkby

Godbolt example

Image

Two polygons are specified in the example above that almost completely overlap. However calling boost::geometry::intersection() on these two polygons in Boost v1.87 does not register as an intersection, whereas it gave the correct result before in Boost v.186 and earlier.

I have found that adding a small 1e-12 perturbation to the vertices of one of the polygons in this example results in the intersection being correctly calculated in v.187, leading me to believe that the vulnerability here occurs when both polygons in the calculation share one or more identical vertices.

Metadata

Metadata

Assignees

No one assigned

    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