Function intersect_convex_convex

Source
pub fn intersect_convex_convex(
    p1: &impl ToInputArray,
    p2: &impl ToInputArray,
    p12: &mut impl ToOutputArray,
    handle_nested: bool,
) -> Result<f32>
Expand description

Finds intersection of two convex polygons

§Parameters

  • p1: First polygon
  • p2: Second polygon
  • p12: Output polygon describing the intersecting area
  • handleNested: When true, an intersection is found if one of the polygons is fully enclosed in the other. When false, no intersection is found. If the polygons share a side or the vertex of one polygon lies on an edge of the other, they are not considered nested and an intersection will be found regardless of the value of handleNested.

§Returns

Area of intersecting polygon. May be negative, if algorithm has not converged, e.g. non-convex input.

Note: intersectConvexConvex doesn’t confirm that both polygons are convex and will return invalid results if they aren’t.

§C++ default parameters

  • handle_nested: true