Closed caspark closed 6 months ago
Thanks for the report.
You're right, I will submit a fix soon.
(For anyone else who stumbles on this issue: I think normally you'd also want to divide the result by two, but this library is only using area to detect polygon winding and relative size of areas, so it shouldn't be necessary here.)
Indeed, that's why the division by 2 is skipped (also, it was also skipped in the original implementation) but maybe a comment about that could help readers of the code.
Published as 0.12.1. Thanks again!
Thanks!
I think the
area
function insrc/area.rs
is not handling the wraparound case correctly:Say
ring
has 10 elements; thenn
== 9 and so the initialization ofarea
is pairing upring[0]
andring[8]
(rather thanring[9]
).A correct implementation could be something like:
(For anyone else who stumbles on this issue: I think normally you'd also want to divide the result by two, but this library is only using
area
to detect polygon winding and relative size of areas, so it shouldn't be necessary here.)