ideasman42 / isect_segments-bentley_ottmann

BentleyOttmann sweep-line implementation (for finding all intersections in a set of line segments)
MIT License
91 stars 40 forks source link

Overlapping segments are not detected #18

Closed anvaka closed 3 years ago

anvaka commented 5 years ago

I was playing with the library to see how it handles edge cases, and I stumbled upon this one, which doesn't seem to be right:

import poly_point_isect

print (
    poly_point_isect.isect_segments_include_segments(
        [
            ((0.0, 0.0),(10.000000, 10.000000)), 
            ((5.0, 5.0),(20.000000, 20.000000))
        ]
    )
)

The output is []. I expected to see both [5, 5] and [10, 10], but maybe I'm missing something?

ideasman42 commented 3 years ago

This case is not handled.

However comparing all edges against all other edges also doesn't show any intersections in this case.

import poly_point_isect

print (
    poly_point_isect.isect_segments__naive([
        ((0.0, 0.0),(10.000000, 10.000000)),
        ((5.0, 5.0),(20.000000, 20.000000))
    ]))

Closing as this isn't a bug in the implementation.