Skip to content

Commit

Permalink
Complete 'linear' module
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Mar 3, 2020
1 parent f8edc3d commit b72ad7a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions bentley_ottmann/core/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from bentley_ottmann.hints import Scalar
from .linear import (RealSegment,
SegmentsRelationship,
segments_intersection)
find_intersection)
from .point import RealPoint


Expand Down Expand Up @@ -92,6 +92,6 @@ def y_at(self, x: Scalar) -> Scalar:
end_x, end_y = self.end
if x == end_x:
return end_y
_, result = segments_intersection(self.segment,
((x, start_y), (x, end_y)))
_, result = find_intersection(self.segment,
((x, start_y), (x, end_y)))
return result
4 changes: 2 additions & 2 deletions bentley_ottmann/core/linear.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from robust.hints import Segment as RealSegment
from robust.linear import (SegmentsRelationship,
segments_intersection,
segments_intersection as find_intersection,
segments_relationship)

from bentley_ottmann.hints import (Base,
Expand Down Expand Up @@ -31,7 +31,7 @@ def find_intersections(left: Segment,
if relationship is SegmentsRelationship.NONE:
return ()
elif relationship is SegmentsRelationship.CROSS:
intersection_point = segments_intersection(left_real, right_real)
intersection_point = find_intersection(left_real, right_real)
if not are_real_segments:
intersection_point = to_scalar_point(intersection_point,
_to_segment_base(left))
Expand Down
4 changes: 2 additions & 2 deletions bentley_ottmann/core/planar.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
EventsQueueKey)
from .linear import (RealSegment,
SegmentsRelationship,
find_intersection,
is_real_segment,
segments_intersection,
segments_relationship,
to_rational_segment,
to_real_segment)
Expand Down Expand Up @@ -127,7 +127,7 @@ def detect_intersection(first_event: Event, second_event: Event,
# segments intersect
yield first_event, second_event

point = segments_intersection(first_segment, second_segment)
point = find_intersection(first_segment, second_segment)
if point != first_event.start and point != first_event.end:
divide_segment(first_event, point, relationship, events_queue)
if point != second_event.start and point != second_event.end:
Expand Down

0 comments on commit b72ad7a

Please sign in to comment.