Open fluffy-marmot opened 2 months ago
Hi, thank you for your detailed feedback!
I really appreciate the time you’ve taken to point out these issues. You’re absolutely right regarding the winding order of the input polygon. I will work on implementing a check for the winding order based on the signed area to ensure that internal angles are correctly determined, as you suggested.
As for the issue with the is_point_inside_triangle function, you’re spot on about the potential floating point precision errors when comparing areas. I’ll look into replacing the current method with the use of barycentric coordinates, which should improve the robustness of the point-in-triangle test.
If you have any other suggestions or find additional issues, feel free to share them—your input is really valuable!
There are some major issues that currently make this nonfunctional: First it doesn't do anything to check winding order of the input polygon; this is necessary to establish which angle is internal. Winding order could be determined by checking the sign of signed area of the polygon.
Even reversing the list given as an example in the readme file gives an incorrect result:
Second, the is_point_inside_triangle is using equality comparison for area, which would likely fail due to floating point errors. A better method might be checking signs of barycentric coordinates: https://en.wikipedia.org/wiki/Barycentric_coordinate_system