Function parry3d::transformation::polygons_intersection

source ·
pub fn polygons_intersection(
    poly1: &[Point2<Real>],
    poly2: &[Point2<Real>],
    out: impl FnMut(Option<PolylinePointLocation>, Option<PolylinePointLocation>)
) -> Result<(), PolygonsIntersectionError>
Expand description

Compute intersections between two polygons that may be non-convex but that must not self-intersect.

The input polygons are assumed to not self-intersect, and to be oriented counter-clockwise.

The resulting polygon is output vertex-by-vertex to the out closure. If two None are given to the out closure, then one connected component of the intersection polygon is complete.

If the polygons are known to be convex, use convex_polygons_intersection instead for better performances.