pub fn boolean_op<'a, I, T, S, C>(
    edge_intersection: I,
    subject: S,
    clipping: C,
    operation: Operation,
    polygon_semantics: PolygonSemantics
) -> MultiPolygon<T> where
    I: Fn(&Edge<T>, &Edge<T>) -> EdgeIntersection<T, T, Edge<T>>,
    T: CoordinateType + Debug + 'a,
    S: IntoIterator<Item = &'a Polygon<T>>,
    C: IntoIterator<Item = &'a Polygon<T>>, 
Expand description

Perform boolean operation.

Example

use iron_shapes_booleanop::*;
use iron_shapes::prelude::*;
let p1 = Polygon::from(vec![(0., 0.), (2., 0.), (2., 2.), (0., 2.)]);
let p2 = p1.translate((1., 1.).into());
let expected_union = Polygon::from(vec![(0., 0.), (2., 0.), (2., 1.), (3., 1.),
                                                (3., 3.), (1., 3.), (1., 2.), (0., 2.)]);

let i = boolean_op(edge_intersection_float, vec![&p1], vec![&p2], Operation::Union, PolygonSemantics::XOR);

assert_eq!(i.len(), 1);
assert_eq!(i.polygons[0], expected_union);