Skip to content

Commit

Permalink
Complete 'find_intersections' function
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Mar 5, 2020
1 parent 2c66943 commit fe643a2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bentley_ottmann/core/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ def find_intersections(left: Segment,
relationship = segments_relationship(left_real, right_real)
if relationship is SegmentsRelationship.NONE:
return ()
elif relationship is SegmentsRelationship.CROSS:
elif relationship is SegmentsRelationship.OVERLAP:
_, first_intersection_point, second_intersection_point, _ = sorted(
left + right)
return first_intersection_point, second_intersection_point
else:
intersection_point = find_intersection(left_real, right_real)
if not are_real_segments:
intersection_point = to_scalar_point(intersection_point,
_to_segment_base(left))
return intersection_point,
else:
_, first_intersection_point, second_intersection_point, _ = sorted(
left + right)
return first_intersection_point, second_intersection_point


def _to_segment_base(segment: Segment) -> Base:
Expand Down

0 comments on commit fe643a2

Please sign in to comment.