Skip to main content

intersect_polygons

Function intersect_polygons 

Source
pub fn intersect_polygons(
    poly1: &Polygon,
    poly2: &Polygon,
) -> Result<Vec<Polygon>>
Expand description

Computes intersection of two polygons

Returns the polygon(s) representing the intersection area. Uses a simplified Weiler-Atherton algorithm.

§Arguments

  • poly1 - First polygon
  • poly2 - Second polygon

§Returns

Vector of polygons representing the intersection

§Errors

Returns error if polygons are invalid