Skip to main content

collect_intersections

Function collect_intersections 

Source
pub(crate) fn collect_intersections(
    h_segments: impl IntoIterator<Item = (CoordY, HSegment)>,
    v_segments: impl IntoIterator<Item = (CoordX, VSegment)>,
) -> BTreeSet<Point>
Expand description

Every crossing of a horizontal segment by a vertical one, by a line sweep in x: each horizontal segment contributes an Enter and an Exit event at its ends, each vertical segment a Scan event at its x, and a Scan reports the horizontal segments active at that moment whose y falls inside its span.