Skip to main content

ring_bad

Function ring_bad 

Source
pub fn ring_bad(ring_index: usize, ring: &[(i32, i32)], bad: &mut Bad)
Expand description

Counts the non-adjacent segment pairs of one ring that intersect, split by kind. The sweep runs over min-x-sorted segments in O(n log n + pairs-in-x-overlap), which is fine at report scale. Crossing/overlap spots land in bad.locs.

ยงPanics

Panics if a ring has more than u32::MAX segments.