Skip to content

Commit

Permalink
Complete 'Union' & 'SymmetricDifference' operations
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Aug 23, 2022
1 parent 4c515c8 commit 13b82a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clipping/core/holey.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ def events_to_polygons(self, events: Sequence[Event]) -> Sequence[Polygon]:
if not events:
return []
max_start_index = events[-1].start_index
assert max_start_index != UNDEFINED_INDEX
assert all(event.start_index <= max_start_index for event in events)
events = [event
for event in events
Expand Down Expand Up @@ -191,11 +192,12 @@ def sweep(self) -> List[Event]:
start_index = event.start_index = 0
self.process_event(event, result, sweep_line)
while events_queue:
event = events_queue.pop()
if event.start != start:
start = event.start
start_index += 1
event.start_index = start_index
self.process_event(events_queue.pop(), result, sweep_line)
self.process_event(event, result, sweep_line)
return result


Expand Down

0 comments on commit 13b82a8

Please sign in to comment.