Function geo_crossings::monotone_chains[][src]

pub fn monotone_chains<T: GeoNum>(poly: Polygon<T>) -> Vec<MonoPoly<T>>
Expand description

Partition a valid polygon into monotone pieces.

Uses the Sweep algorithm to parition a polygon into sub-polygons, each of which is monotone. The sub-polygons are returns as a pair of the top and bottom line-string.

Validity

Only non-self intersecting polygons are accepted. That is, no two edges of any of the exterior or interior rings may intersect internally. Further, the graph formed by the vertices and the edges must be a 2-degree regular graph. Note that the algorithm may panic arbitrarily on invalid input.