polyops 0.1.0

Fast Martinez-Rueda polygon clipping: Boolean operations (intersection, union, difference, xor) on polygons and multipolygons over GeoJSON-shaped coordinates. Pure-Rust port of martinez-polygon-clipping.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Boolean operation enum, mirroring upstream `src/operation.ts`.

/// Which Boolean operation to perform.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub enum Operation {
    /// `subject ∩ clipping`
    Intersection = 0,
    /// `subject ∪ clipping`
    Union = 1,
    /// `subject \ clipping`
    Difference = 2,
    /// `subject ⊕ clipping`
    Xor = 3,
}