Skip to content

Commit

Permalink
Complete 'core' package
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Mar 26, 2021
1 parent 479dba3 commit e377795
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bentley_ottmann/core/events_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _divide_segment(self, event: Event, break_point: Point) -> None:
event.segments_ids, event.relations)
right_event = event.complement = Event(
break_point, event, False, event.original_end,
event.complement.segments_ids, event.relations)
event.complement.segments_ids, event.complement.relations)
self.push(left_event)
self.push(right_event)

Expand Down
7 changes: 6 additions & 1 deletion bentley_ottmann/core/sweep_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,13 @@ def __lt__(self, other: 'SweepLineKey') -> bool:
# segments have same start
elif end_y != other_end_y:
return end_y < other_end_y
else:
elif end_x != other_end_x:
return end_x < other_end_x
else:
# segments fragments are equal
return ((event.original_start.y, event.original_start.x)
< (other_event.original_start.y,
other_event.original_start.x))
elif start_y != other_start_y:
return start_y < other_start_y
else:
Expand Down

0 comments on commit e377795

Please sign in to comment.