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

AssertionError assert(event.in_sweep == False) #28

Open flazouh opened 1 year ago

flazouh commented 1 year ago

Does anyone have a clue why these lines causes this assertion to not pass ?

lines = [((-9708, 1440), (10288, 1083)), ((-9700, 2429), (10286, 3158)), ((-8530, 2364), (11446, 3303)), ((1965, -8764), (1754, 11234)), ((288, -8534), (285, 12338)), ((1726, -7542), (1959, 12456))]
File "/Users/alex/PycharmProjects/fast_api_chess/poly_point_isect.py", line 616, in isect_segments
    return isect_segments_impl(segments, include_segments=False, validate=validate)
  File "/Users/alex/PycharmProjects/fast_api_chess/poly_point_isect.py", line 598, in isect_segments_impl
    sweep_line.handle(p, events_current)
  File "/Users/alex/PycharmProjects/fast_api_chess/poly_point_isect.py", line 391, in handle
    self.handle_event(e)
  File "/Users/alex/PycharmProjects/fast_api_chess/poly_point_isect.py", line 431, in handle_event
    if self.remove(e):
  File "/Users/alex/PycharmProjects/fast_api_chess/poly_point_isect.py", line 353, in remove
    assert(event.in_sweep == False)
AssertionError

Thanks in advance!