Bentley-Ottmann populates a heap with the path's linesegments as "start" events, whilst tracking which of those line-segments intersects the current scanline in a doubly-linkedlist. Which can readily be transformed into axis-aligned trapagons!
Upon "start" it inserts the line into the scanline computing the next intersection, if any, with consecutive lines emitting appropriate events. Upon "intersect" it swaps linesegments on the scanline & computes next intersections, if any.
4/5!