Re: fill-rule:nonzero;

Burton Radons wrote:
> 
> I see from the archives what fill-rule:evenodd; is supposed to do, but
> nonzero (Which is used in the Adobe Illustrator exports, such as the
> Mozilla example) is a cipher.  Is it as with TrueType, where clockwise
> lines add one to a count and counterclockwise subtract one, and positive
> values are fill, or is it another algorithm?

Hi Burton,

The latest public working draft (3rd March 2000) doesn't have a 
description of fill-rule. The next public release will probably
say something like this:

evenodd 
This rule determines the "insideness" of a point on the canvas by
drawing
a ray from that point to infinity in any direction and counting the
number
of path segments from the given shape that the ray crosses. If this
number 
is odd, the point is inside; if even, the point is outside.

nonzero 
This rule determines the "insideness" of a point on the canvas by
drawing
a ray from that point to infinity in any direction and then examining
the 
places where a segment of the shape crosses the ray. Starting with a
count 
of zero, add one each time a path segment crosses the ray from left to 
right and subtract one each time a path segment crosses the ray from
right 
to left. After counting the crossings, if the result is zero then the
point 
is outside the path. Otherwise, it is inside.

There will probably also be illustrations of the two rules.

The Adobe, CSIRO and IBM implementations
process fill-rule correctly, so you could make your own examples
if you can't wait for the next public draft.

Dean

Received on Tuesday, 20 June 2000 22:24:26 UTC