原文如下:
I have played quite a bit with AGG these last weeks and I have come up with following problem: when painting wide outlines of paths with sharp edges, AGG somehow messes up.
作者的回答:
Well, it‘s not that trivial. I honestly don‘t know a simple solution of that. The stroke converter is the simplest and the fastest one, but it can produce some defects. The defects are rooted from self-intersecting polygons that appear wnen working with very sharp angles and wide strokes:http://www.antigrain.com/img/self_intersections.gifThese kinds of defects are eliminated when rendering if you use the non-zero fill rule. However, in more complex cases there can be more than two self-intersecting areas overlapping each other. As a result we can have some holes even with non-zero filling. Of course, it‘s possible to get rid of self-intersections analytically, but it‘ll be much more complex (and much slower) algorithm. Ideally, we need to calculate the Minkowsky Sum. Anyway, it should be a separate converter that works slower, but produces perfect result.
交流过程:
> These kinds of defects are eliminated when rendering if you use the > non-zero fill rule. However, in more complex cases there can be more than > two self-intersecting areas overlapping each other. As a result we can > have some holes even with non-zero filling. In my case, I was using the non-zero fill rule, and I have indeed ran into one of those complex cases. > Of course, it‘s possible to get rid of self-intersections analytically, > but it‘ll be much more complex (and much slower) algorithm. Ideally, we > need to calculate the Minkowsky Sum. Anyway, it should be a separate > converter that works slower, but produces perfect result. Do you have any plans of implementing such a converter ?
可能的解决方案:
for example, Klaas‘s library does that, maybe not very fast and stably for the moment, but the approach definitely worth considering.
时间: 2025-01-31 09:24:53