sortAndSweepBipartite

fun sortAndSweepBipartite(points: List<BoxedPointOrEdge>, edges: List<BoxedPointOrEdge>, onIntersect: (Int, Int) -> Unit)(source)

Processes a collection of points and edges in a bipartite structure using a sweep-line algorithm to detect and handle intersections. The method categorizes objects into active points and edges, iteratively updates the active lists, and invokes the intersection callback when overlaps are detected.

Parameters

points

a list of BoxedPointOrEdge instances representing points in the coordinate space. Objects with type 0 are considered points.

edges

a list of BoxedPointOrEdge instances representing edges in the coordinate space. Objects with type 1 are considered edges.

onIntersect

a callback function invoked with the indices of intersecting objects when a point and an edge intersect. The first parameter is the index of the intersecting point, and the second parameter is the index of the intersecting edge.