Weird behaviour fill tonext

Hi all,

I’m trying to render patches with holes in them. I can achieve that by adding a scatter trace for the outside edge of the patch, and a scatter trace for the inside edge of the patch, with a fill: tonext on the latest added trace.

For simple shapes, that works, but if the shapes get a bit more complicated, the hole is not cutout properly. See example:

https://codepen.io/mkatgert/pen/myVmvyM

The left shape has been created by adding the ‘hole edge’ first, and then the outer edge, and then the outer edge has a fill tonext.

The right shape follows the exact same logic, but the hole is not cut out.

Is this a bug or am I doing something wrong?

1 Like

It could be a mistake, the “d” parameter for filling is well implemented but it seems they forgot to add the fill-rule=“evenodd” parameter, I’ll leave it as homework for you.

I tried all the values ​​for fill and none of them worked, maybe they need to add an evennod value for the fill, hopefully in future versions they will add it or maybe I could be wrong too