Skip to content

Support for Fillrule.NonZero in addition to current FillRule.EvenOdd? #8

Description

@Fribur

When doing Boolean operations on polygons, it is often essential to be able to select different fillrules: Non-Zero, Even-Odd, Positive, Negative, which is derived from the winding number (nice visual in Clipper2 documentation).

I got a use case with Variable Fonts: pretty much all of them have glyphs defined via self-overlapping outlines. The overlaps are to be considered "overlaps", and not "holes". I can accomplish this by setting the Fillrule in Clipper2 to FillRule.NonZero or Fillrule.Negative (Clipper2 supports all 4 FillRules mentioned above, most graphics libraries support at least FillRule.Even-Odd and FillRule.Non-Zero).

It looks like Polybool only supports FillRule.Even-Odd? Is it in principle possible to add FillRule.NonZero functionality to PolyBool, e.g. by defining new selection rules or new annotation rules? Or is it simply not possible via this approach? If possible, I would appreciate a hint how, and I might give it a stab to implement this.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions