nonZeroSelfUnion

Resolves a region whose rings may self-intersect, self-touch, or overlap into an equivalent region made up of simple rings, under the nonzero fill rule: a point belongs to the result iff windingNumber around it is nonzero.

The region is first split at its own self-intersections (and self-touching vertices, exactly as union does for the even-odd rule), so that every arc of the resulting boundary runs between two points where the winding number can change. Each arc is then kept -- oriented so its interior faces left, matching this library's CCW-positive convention -- only where the two sides disagree on whether they're "inside" (nonzero) or "outside" (zero); arcs whose sides agree don't border a winding-number change and are discarded.