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

Closed horizontal path causes crash #24

Closed ghost closed 3 years ago

ghost commented 3 years ago

The following line

poly_point_isect.isect_polygon([[1,1], [0,1], [1,1]])

causes a crash, more specifically an AssertionError.

I can understand that the desired result for this edge case might be arguable, but it should not crash everything. And since the coordinates in this case are integers, and the line segments are horizontal, there should not be any issues of "near-vertical segments" or numerical precision problems.