Skip to content

Commit

Permalink
Complete 'edges_intersect' function
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Jan 9, 2021
1 parent d63e738 commit 74c89a7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bentley_ottmann/planar.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,10 @@ def non_neighbours_intersect(edges_ids: Iterable[Tuple[int, int]],
and (segment_id != 0 or next_segment_id != last_edge_index)
for segment_id, next_segment_id in edges_ids)

return any((first_event.relation is _Relation.OVERLAP
or second_event.relation is _Relation.OVERLAP
non_overlap_relations = (_Relation.CROSS, _Relation.DISJOINT,
_Relation.TOUCH)
return any((first_event.relation not in non_overlap_relations
or second_event.relation not in non_overlap_relations
or non_neighbours_intersect(_to_pairs_combinations(_merge_ids(
first_event.segments_ids, second_event.segments_ids))))
for first_event, second_event in _sweep(edges))
Expand Down

0 comments on commit 74c89a7

Please sign in to comment.