A robot map or annotation can contain several closed paths while leaving the intended interior ambiguous. Two nested loops with identical coordinates can describe a filled center under one rule and an empty center under another.

The difference follows the rule used to combine boundary crossings. An even–odd rule counts crossings modulo two. A nonzero winding rule retains their direction and tests the signed total.

The original paths below explain the distinction in exact planar geometry. They are not a robot footprint validation, navigation policy, rendered image, or measured scene boundary.

Declare paths rather than assuming one simple polygon

Use a Cartesian plane with x increasing right and y increasing upward. The exterior square follows (0, 0), (10, 0), (10, 10), (0, 10), then closes to (0, 0). Its traversal is counterclockwise.

The inner square initially follows (3, 3), (7, 3), (7, 7), (3, 7), then closes. It is also counterclockwise.

Treat these as two separate closed subpaths of one compound region description. They are not one simple polygon joined by an implied connecting edge. Their geometric coordinates and traversal directions are both part of the input.

W3C's SVG fill-rule section defines nonzero winding and even–odd interiors. Qt's official FillRule documentation describes the same two abstract choices. Those references motivate the rules; the square paths and point calculations here are independently constructed.

Count crossings from a central point

Choose P = (5, 5), strictly inside both squares. Draw a horizontal ray from P toward increasing x. It crosses the inner right edge at x = 7 and the exterior right edge at x = 10.

There are two crossings. The even–odd rule therefore classifies P as outside: an even count has parity zero.

For a signed convention, count an upward edge crossing as +1 and a downward edge crossing as −1 when its intersection lies to the right of P. Both crossed right edges point upward in the declared counterclockwise traversals.

The winding total is +2. Under the nonzero rule, P is inside because that total is not zero.

The same two path geometries consequently give different central interiors. No floating-point error, grid sampling, or noisy measurement is needed to produce the disagreement.

Reverse the inner traversal

Keep every inner-square point in the same geometric location, but traverse the inner loop clockwise. Its right edge now points downward.

The ray from P still crosses two edges at x = 7 and x = 10. Even–odd classification remains outside because the number of crossings has not changed.

The signed total instead becomes −1 + 1 = 0. The nonzero rule now also classifies P as outside. Reversing the inner path changed its winding contribution and turned the center into a hole under that rule.

Thus the nonzero rule uses orientation information that parity discards. It is insufficient to retain only a list of undirected boundary locations when the intended region depends on winding.

Reversing both paths would change the sign of every winding contribution while preserving whether the total is zero. The choice of calling upward crossings positive determines a sign convention; nonzero membership depends on cancellation, not that overall sign.

Check a point between the squares

Let Q = (1, 5), inside the exterior square but outside the inner square. Its rightward ray crosses the inner left edge at x = 3, the inner right edge at x = 7, and the exterior right edge at x = 10.

There are three crossings, so even–odd classifies Q as inside. With both loops counterclockwise, the signed contributions are −1, +1, and +1, giving total +1. Nonzero also classifies it as inside.

Reversing the inner path changes its pair of contributions to +1 and −1. They still cancel, leaving the exterior contribution +1. Q remains inside under both rules.

For an exterior point R = (12, 5), the same rightward ray crosses neither square. Its crossing count and winding total are zero, so both rules classify it as outside.

These point checks identify where the two region definitions differ: the doubly enclosed center, rather than every location inside the outer square.

Handle boundaries before applying an interior rule

Choose B = (7, 5), exactly on the inner right edge. The point is neither strictly on one side of that edge nor strictly on the other. The preceding interior examples intentionally avoided this case.

A geometric classifier can report boundary separately by first checking whether a point lies on any segment. For exact coordinates, collinearity plus inclusion within the segment's endpoint bounds identifies that relationship.

The application can then choose whether boundary counts as included, excluded, or a separate result. An interior fill rule alone should not be used to silently supply a collision-contact or annotation-boundary policy.

With floating-point measurements, a tolerance for near-edge classification introduces an additional modeling choice. Its unit, scale, and intended interpretation need to be stated; it is not determined by the words winding or even–odd.

Avoid counting a ray vertex twice

For an implementation of horizontal ray crossings, a half-open vertical-span convention can avoid treating a shared vertex as two independent crossings. An upward edge can qualify when y_start <= y_point < y_end, with the corresponding reversed inequality for a downward edge.

Horizontal edges are not ordinary transverse crossings, and points on them belong to the separate boundary check. Tangent or coincident rays likewise need consistent handling rather than an accidental count.

The examples used y = 5, which avoids all square vertices. They establish the rule differences without relying on a particular numerical implementation of those edge cases.

For robot region records, retain the subpath structure, closure, traversal directions, fill rule, and boundary classification policy. The same path coordinates can then be interpreted reproducibly, while physical occupancy and contact remain questions for the separately declared robot geometry model.

Sources checked October 23, 2026

W3C SVG 2, Painting, section 13.4.2 Winding rule: fill-rule:

https://www.w3.org/TR/SVG2/painting.html

Qt Namespace, Qt 6.12.0 accessed edition, FillRule:

https://doc.qt.io/qt-6/qt.html

All paths, points, crossing totals, and classifications are original hypothetical calculations. No geometry or rendering library was executed.

Illustration note: A generic robot vision scene is a concept illustration. It does not show the constructed paths, verified occupancy, or a validated robot clearance result.