Java Reference
In-Depth Information
Winding Rule
Description
WIND _ EVEN _ ODD
In this case, a point is interior to a GeneralPath object if the
boundary is crossed an odd number of times by a line from a
point exterior to the GeneralPath to the point in question.
You can use this winding rule for any kind of shape, including
shapes with holes.
WIND _ NON _ ZERO
In this case, whether a point is inside or outside a path is
determined by considering how the path crosses a line drawn
from the point in question to infinity taking account of the
direction in which the path is drawn. Looking along the line
from the point, the point is interior to the GeneralPath object
if the difference between the number of times the line is crossed
by a boundary from left to right, and the number of times from
right to left is non-zero. You can use this rule for general paths
without holes - in other words, shapes that are bounded by a
single contiguous path. This rule does not work for shapes
bounded by more than one contiguous path - with holes in
other words - since the result will vary depending on the
direction in which each path is drawn. However, it does work
for a closed re-entrant path - a path that intersects itself.
These winding rules are illustrated below:
The safe option is WIND _ EVEN _ ODD .
There are four constructors for GeneralPath objects:
Search WWH ::




Custom Search