Closed mmatrosov closed 5 years ago
I just discovered that if you scale all the coordinates and values by 1000, the issue is gone. Maybe the problem is in some absolute epsilon values?
We will this year remove rescaling internally from overlay and buffer, and I think that will fix this issue. Because of this, and because you have a workaround, and because I have not much time now, I have to leave it like this, sorry if this is inconvenient. We can leave the ticket open to check after removing rescaling.
Glad you had a chance to review the issue! Good luck with your rework!
Sorry for the (very delayed) follow up. I believe it is working correctly now, with and without rescaling. This testcase is added to the testsuite. Rescaling is still not gone from the released library, but much further and hopefully it will be released in one or two releases. But your testcase also works with rescaling (at least: now).
Better later than never :)
See the demo: http://melpon.org/wandbox/permlink/yMk39ZquRHSIZmKZ
I'm dilating (buffering with positive distance) a small triangle, then convert both input and output polygons to linestrings and measure distance between them. Instead of expected distance I got zero. Output polygon has quite strange shape.
The demo produces WKT for input and output shapes:
That's how these shapes look on https://arthur-e.github.io/Wicket/sandbox-gmaps3.html:
Thin vertical bar in the middle is the input. The wide shape is the output. If I tweak input a little, e.g. remove the second vertex from the input polygon, result is correct:
Thus I assume my method is correct. Sorry for the strange numbers, I took them from the data I'm currently working on to prepare a repro-case for you. Here is the image of what I get in my project:
Look for two red outlines, other stuff is irrelevant. The bigger one is the dilated version of the smaller one. As you can see, it has incorrect shape on the left top side.