Trait iron_shapes_booleanop::BooleanOp
source · [−]pub trait BooleanOp<T: CoordinateType> {
fn boolean_op(
&self,
operation: Operation,
other: &Self,
polygon_semantics: PolygonSemantics
) -> MultiPolygon<T>;
fn intersection(&self, other: &Self) -> MultiPolygon<T> { ... }
fn difference(&self, other: &Self) -> MultiPolygon<T> { ... }
fn union(&self, other: &Self) -> MultiPolygon<T> { ... }
fn xor(&self, other: &Self) -> MultiPolygon<T> { ... }
}Expand description
Trait for geometric primitives that support boolean operations.
Required Methods
fn boolean_op(
&self,
operation: Operation,
other: &Self,
polygon_semantics: PolygonSemantics
) -> MultiPolygon<T>
fn boolean_op(
&self,
operation: Operation,
other: &Self,
polygon_semantics: PolygonSemantics
) -> MultiPolygon<T>
Compute the boolean operation of self and other.
Parameters
operation: The type of boolean operation to be computed (intersection, union, difference, XOR).other: The other operand. A geometric object of the same type asself.polygon_semantics: Define the ‘inside’ of a polygon. In case of doubtUnion-semantics could be a good choice.
Provided Methods
fn intersection(&self, other: &Self) -> MultiPolygon<T>
fn intersection(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean intersection self & other.
Union semantics are used for self-overlapping polygons.
fn difference(&self, other: &Self) -> MultiPolygon<T>
fn difference(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean difference self - other.
Union semantics are used for self-overlapping polygons.
fn union(&self, other: &Self) -> MultiPolygon<T>
fn union(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean union self | other.
Union semantics are used for self-overlapping polygons.
fn xor(&self, other: &Self) -> MultiPolygon<T>
fn xor(&self, other: &Self) -> MultiPolygon<T>
Compute the boolean exclusive OR self ^ other.
Union semantics are used for self-overlapping polygons.