pub enum PolygonSemantics {
    Union,
    XOR,
}
Expand description

Define the ‘inside’ of a polygon. Significant for self-overlapping polygons.

  • Union: A point p is inside the polygon if the winding number is larger than 0. This means that if a polygon overlaps with itself or multiple polygons overlap, the overlapping area is always ‘inside’.
  • XOR: A point p is inside the polygon if the winding number modulo 2 is larger than 0. This means that if an odd number of polygons overlap, the overlapping area is ‘inside’ the polygon. In case of an even number of overlaps, the overlapping area is ‘outside’.

This plays an important role for self-overlapping polygons and self-overlapping multi-polygons.

Variants

Union

A point p is inside the polygon if the winding number is larger than 0.

XOR

A point p is inside the polygon if the winding number modulo 2 is larger than 0.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.