Enum FillRule

java.lang.Object
java.lang.Enum<FillRule>
com.github.micycle1.clipper2.core.FillRule
All Implemented Interfaces:
Serializable, Comparable<FillRule>, java.lang.constant.Constable

public enum FillRule extends Enum<FillRule>
Complex polygons are defined by one or more closed paths that set both outer and inner polygon boundaries. But only portions of these paths (or 'contours') may be setting polygon boundaries, so crossing a path may or may not mean entering or exiting a 'filled' polygon region. For this reason complex polygons require filling rules that define which polygon sub-regions will be considered inside a given polygon, and which sub-regions will not.

The Clipper Library supports 4 filling rules: Even-Odd, Non-Zero, Positive and Negative. These rules are base on the winding numbers (see below) of each polygon sub-region, which in turn are based on the orientation of each path. Orientation is determined by the order in which vertices are declared during path construction, and whether these vertices progress roughly clockwise or counter-clockwise.

By far the most widely used filling rules for polygons are EvenOdd and NonZero, sometimes called Alternate and Winding respectively.

https://en.wikipedia.org/wiki/Nonzero-rule

  • Enum Constant Details

    • EvenOdd

      public static final FillRule EvenOdd
      Only odd numbered sub-regions are filled
    • NonZero

      public static final FillRule NonZero
      Only non-zero sub-regions are filled
    • Positive

      public static final FillRule Positive
      Only sub-regions with winding counts > 0 are filled
    • Negative

      public static final FillRule Negative
      Only sub-regions with winding counts < 0 are filled
  • Method Details

    • values

      public static FillRule[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static FillRule valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null