Skip to main content

polygon_union

Function polygon_union 

Source
pub fn polygon_union(a: &[Point2], b: &[Point2], tol: f64) -> Vec<Vec<Point2>>
Expand description

Union of two simple polygons.

Both inputs should be simple (non-self-intersecting) polygons; orientation is normalized internally, so either winding is accepted. Returns the outer loop(s) of the union; holes (if the union encloses a void) are dropped from this convenience wrapper — use polygon_boolean if you need them.

Returns an empty Vec if either input is degenerate (fewer than 3 non-collinear vertices) or the arrangement could not be traced.