No intersection for polygons with close boundaries · Issue #1487 · boostorg/geometry · GitHub
Skip to content

No intersection for polygons with close boundaries #1487

Open

Description

@mjacobse

No intersection is returned for the example
Image

where the intersection should basically be the green polygon. This is on develop with #1479 already merged.

Here is the example written as test case: mjacobse@42e03ee
It fails with the output

libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp(137): error: in "test_main_caller( argc_ argv )": intersection: issue_1487 #outputs expected: { 1} detected: 0 type: d
libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp(155): error: in "test_main_caller( argc_ argv )": intersection: issue_1487 #area expected: 18983.884971862571547 detected: 0 type: d
libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp(137): error: in "test_main_caller( argc_ argv )": intersection: issue_1487 #outputs expected: { 1} detected: 0 type: d ccw
libs/geometry/test/algorithms/set_operations/intersection/test_intersection.hpp(155): error: in "test_main_caller( argc_ argv )": intersection: issue_1487 #area expected: 18983.884971862571547 detected: 0 type: d ccw

Activity

  1. mjacobse commented on Aug 28, 2026

    @mjacobse
    ContributorAuthor

    Running boost::geometry::simplify on the green polygon first to remove collinear vertices seems to work around the issue and passes the test (even with max_distance == 0.0, see 8e63efd).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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