Closed bluenote10 closed 4 years ago
Thank you very much for this catch, my gut told me that I've forgot something along those lines..:
As you can see I already have evenodd for the unisample svgs but I forgot to update the duplicated versions of svg.js, will fix that tomorrow I hope :)
I use evenodd now everywhere and I've added your feature branch since it's so easy :)
I use evenodd now everywhere and I've added your feature branch since it's so easy :)
Cool thanks!
I noticed that currently the SVGs don't specify a
fill-rule
, which means that they default to anonzero
fill rule (i.e., winding order matters). Some thoughts:foo
andtwointersectingcontours
been generated? It seems using "evenodd" fill rule is necessary to obtain them. This inconsistency leads to some wrong results: For instance, rust-geo-booleanop has an optimization when performing a union operation with an empty polygon: It returns the other polygon as is. Currently this shows a wrong result, because the input polygon gets converted wrongly.Depending on what you want to achieve (testing for correctness w.r.t. evenodd or nonzero rules) you may either fix the input polygons or change the SVG conversion to evenodd. This can be done by changing line 9 of
svg.js
to:This fixes a lot of "false negatives" for me as shown here: https://github.com/21re/rust-geo-booleanop/pull/15