logoalt Hacker News

Lichtsotoday at 10:03 AM1 replyview on HN

There are two ways to get winding numbers and then decide on filled or empty by some rule like non-zero or even-odd:

a) The winding number of a point is the number of intersections of a scanline and a closed path.

b) The winding number around a point is the total angle subtended by the path at that point.

Slug uses approach a) and that comes with a lot of edge cases (see chart in the post) and numerical precision issues. The approach by loop & blinn uses b) and is thus simpler and more robust. Likewise the patent on that one expired too: https://news.ycombinator.com/item?id=47416736#47420450


Replies

jeremiahkellicktoday at 3:25 PM

Loop and blinn does not compute a winding number using the b) method. It avoids the issue of a winding number by assuming there's only 1 bezier curve per triangle, which requires a complicated triangulation step. It can produce some nasty geometry in more complex cases. With Slug, you can use only 1 quad per glyph if you want.

Also just to clarify regarding this statement:

> Slug uses approach a) and that comes with a lot of edge cases (see chart in the post) and numerical precision issues

Slug does not have numerical precision issues. It's the breakdown into different cases that _solves_ those issues, whereas your statement makes it sound like slug has _both_ the case complexity and the precision issues.